Re: question on sql
- From: "W.G. Ryan - MVP" <WilliamRyan@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jan 2006 10:43:20 -0500
"ken" <ken@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD1922C8-2915-41B1-834D-DB17BC8020CD@xxxxxxxxxxxxxxxx
> Dear all
> 1.)How can i save the stored procedure in sql 2005 server, into server and
> NOT in file location
--Do you want to just create a Stored Procedure via Code and not have to
read it in from a file, and then be able to retrieve it? If so, you can
just set your commandtext property of your command object to the stored proc
code, and you can use sp_helptext '[ @objname = ] 'name' [ , [ @columnname
= ] computed_column_name ] to retrieve the text afterward. If you use a
datareader for instance, you'd just set the CommandType to to
CommandType.StoredProcedure. Then you'd add the @objname parameter which
would be the name of the proc you just wrote. You can use a dataReader and
then use SqlDataReader dr = MyCommandName.ExecuteReader(and a
commandbehavior here as you normally would).
Then while(dr.Read()){
Debug.WriteLine(dr[0].ToString());
}//Or however you want the text, I'm just using WriteLine for illustrative
purposes
>
> 2.)How can create folder in stored procedure to separate categories?
--I'm not sure I follow you here. Are you looking for some sort of folder
structure with Management Studio? If so, I don't know of a way to
accomplish that (note though that I'm not saying it can't be done, I'm just
personally unaware of such a feature - but would like to know the answer as
well).
>
> 3.)How can view the created date and modify date of stored pro
--I believe you can check the system catalog and look at Sysobjects for
instance - looking at the crdate field. There is probably a new management
view as well that has this, I don't happen to know of one off the top of my
head. You may want to run this by the Sql Server NG group as well in that
there is probably a newer more elegant way to get at this data, I'm not
sure.
HTH,
Bill
>
>
>
>
.
- Follow-Ups:
- Re: question on sql
- From: William \(Bill\) Vaughn
- Re: question on sql
- Prev by Date: Re: click event handler executed twice
- Next by Date: Re: What causes SqlCommandBuilder to not build commands?
- Previous by thread: DataReader Limits data returned!
- Next by thread: Re: question on sql
- Index(es):
Relevant Pages
|