Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 script a known stored procedure

Author  Topic 

djseng
Starting Member

25 Posts

Posted - 2008-05-13 : 09:43:29
So is there any other way to script a procedure if you already know its name... Typically I move my hand to the mouse go to the object browser, find it in the huge list, right click on in, script stored procedure as alter to clipboard... sp_helptext isn't adequate for editing either because it's output isn't exactly the same, tabs are transformed and etc. Preferably, if I've found the procedure name in another application I have it's name copied onto my clipboard already, and since my memory isn't that great, i've got it paste in a query window anyway because it takes so long sometimes to load up the object browser tree...

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 10:28:14
sp_helptext 'sp name here'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

djseng
Starting Member

25 Posts

Posted - 2008-05-13 : 10:44:39
yeah, still not lazy enough for me... then i still need to figure out how to get that result from the results window and that formatting is all messed up... i.e. it's not the same output as what I would get by performing the other procedure.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 10:54:13
If you execute the above suggestion in TEXT mode, you will get exact copy of procedure.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

djseng
Starting Member

25 Posts

Posted - 2008-05-13 : 11:04:41
Wow, I must be on something, I could have swore that replaced the tabs... sorry about that.

Thanks!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 11:08:19
GRID mode "replaces" the tabs.


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -