Thursday, March 29, 2012
Granting stored procedure execute permissions from ASP.NET?
I do not have direct access to our SQL Server but I have full FTP access to the web server and have the db Username/passwords.
I need to grant execute permissions on a stored procedure, can I do this from an asp/ASP.NET page?
The DB guys take 24 hours to run a script against the database!
Any help would be greatfully recieved.
Rich
You can use a SqlCommand object, and set the command text to something like this:
Grant Execute Onsp_name To ASPNET
Then use .ExecuteNonQuery()
Friday, March 9, 2012
Good idea or not to enable write caching ..
All our disks are direct attached storage.
Thanks
Only if it is battery backed should you enable it. But if it is then
enabling it can provide a dramatic boost for writes especially for
checkpoints. You may even want to change the default read to write cache
ratio to give it more write cache.
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Dw36D7VGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Is it a good idea or not to enable write caching on the array controller ?
> All our disks are direct attached storage.
> Thanks
>
Good idea or not to enable write caching ..
All our disks are direct attached storage.
ThanksOnly if it is battery backed should you enable it. But if it is then
enabling it can provide a dramatic boost for writes especially for
checkpoints. You may even want to change the default read to write cache
ratio to give it more write cache.
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Dw36D7VGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Is it a good idea or not to enable write caching on the array controller ?
> All our disks are direct attached storage.
> Thanks
>
Good idea or not to enable write caching ..
All our disks are direct attached storage.
ThanksOnly if it is battery backed should you enable it. But if it is then
enabling it can provide a dramatic boost for writes especially for
checkpoints. You may even want to change the default read to write cache
ratio to give it more write cache.
--
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Dw36D7VGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Is it a good idea or not to enable write caching on the array controller ?
> All our disks are direct attached storage.
> Thanks
>
Good documentation tool
if anybody could direct me to a free DB documentation tool for SQL2K that'll
be great. Since we're running out of budget (usual year end crunch, blah
blah!), we cannot budget for buying any new tool...if anyone also knows diff
tools that could be used within SQL2K, pls suggest in brief how to make use
of it for documenting Tables, Triggers, Relation Diagram and Data Dictionary
TIA
I wrote an article on "DB documentation" last year. I have provided the sql
scripts also. Check out http://www.microsoft.com/india/msdn/articles/169.aspx
whether it would be of any help to you.
Pls be adviced that you might need to change the scripts to adhere to ANSI
Joins if at all you are bothered about performance.
Best Regards
Vadivel
http://vadivel.blogspot.com
http://thinkingms.com/vadivel
"parasada" wrote:
> hi all,
> if anybody could direct me to a free DB documentation tool for SQL2K that'll
> be great. Since we're running out of budget (usual year end crunch, blah
> blah!), we cannot budget for buying any new tool...if anyone also knows diff
> tools that could be used within SQL2K, pls suggest in brief how to make use
> of it for documenting Tables, Triggers, Relation Diagram and Data Dictionary
> TIA
Wednesday, March 7, 2012
going from sqlconnection and sqlreader to using a tableadapter and ????
Below is my code right now Im using a direct sqlconnection for each request.? I would like to use Tableadapters and/or my BLL code like the rest of my sites pages.? I cant find how to do this progamatically and using the xmltextwriter. (Also i need to be able to name the xml output nodes like below)
Thanks for the help.
Neil
Private Sub GetAllEvents(ByVal SqlString)
? ? ? ? Response.Clear()
? ? ? ? Response.ContentType = "text/xml"
? ? ? ? Dim objX As New XmlTextWriter(Response.OutputStream, Encoding.UTF8)
? ? ? ? objX.WriteStartDocument()
? ? ? ? objX.WriteStartElement("Events")
? ? ? ? Dim objConnection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\*********.mdf;Integrated Security=True;User Instance=True")
? ? ? ? objConnection.Open()
? ? ? ? Dim sql As String = SqlString
? ? ? ? Dim objCommand As New SqlCommand(sql, objConnection)
? ? ? ? Dim objReader As SqlDataReader = objCommand.ExecuteReader()
? ? ? ? While objReader.Read()
? ? ? ? ? ? objX.WriteStartElement("Event")
? ? ? ? ? ? objX.WriteAttributeString("EventId", objReader.GetInt32(0))
? ? ? ? ? ? objX.WriteAttributeString("EventName", objReader.GetString(1))
? ? ? ? ? ? objX.WriteAttributeString("EventDescription", objReader.GetString(2))
? ? ? ? ? ? objX.WriteAttributeString("EventDate", objReader.GetDateTime(3))
? ? ? ? ? ? objX.WriteAttributeString("CurrentDate", Date.Now.ToString)
? ? ? ? ? ? If Not objReader.IsDBNull(12) Then
? ? ? ? ? ? ? ? objX.WriteAttributeString("EventImage", objReader.GetString(12))
? ? ? ? ? ? End If
? ? ? ? ? ? objX.WriteEndElement()
? ? ? ? End While
? ? ? ? objReader.Close()
? ? ? ? objConnection.Close()
? ? ? ? objX.WriteEndElement()
? ? ? ? objX.WriteEndDocument()
? ? ? ? objX.Flush()
? ? ? ? objX.Close()
? ? ? ? Response.End()
? ? End Sub
Hi,
If you wish to write all the content of the query result to an Xml, I suggest you do the following step:
1. Use a SqlDataAdapter to fill a DataSet.
2. Call DataSet.WriteXml(REsponse.OutputStream) to output it.
Dim objConnection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\*********.mdf;Integrated Security=True;User Instance=True")
objConnection.Open()
Dim sql As String = SqlString
Dim DA As New SqlDataAdapter(sql, objConnection)
Dim ds As New DataSet()
DA.Fill(ds)
ds.WriteXml(Response.OutputStream)
HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!
|||That works great, However I need to have complete control over which fields are put in nodes and into attributes. We are passing the xml into flash and need to have control over each field. I have pre made table adapters and a BLL that handles all of the "BackEnd" Functions for administration. Trying to use those for the xml output as well(Dont want to dble code). Thanks for the help