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
 Transact-SQL (2005)
 quick question on script generation from SSMS

Author  Topic 

MichaelHLutz
Starting Member

19 Posts

Posted - 2008-12-30 : 09:26:00
Hi. I am trying to obtain a script for all stored procedures in my database. I need each SP to be in its own file. I understand how to achieve this through SSMS manually, and I don't need to automate the process.

My problem is that when I generate a file per object SSMS appends StoredProcedure to the name of the file, e.g. :

MyStoredProcName.StoredProcedure.sql

This is not what I want. Rather I need the filename to be :

MyStoredProcedure.sql

Is it possible using SSMS to generate a file per object, but **not** append the object type like it is currently doing? I looked through the options during generation and didn't see anythhing suiting this need.

Thanks in advance,
Mike

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-01-08 : 11:17:54
Two DOS commands would fix this:
REN C:\temp\*.storedprocedure.sql *.
REN C:\temp\*.storedprocedure *.sql

Put into batch or xp_cmdshell.
Go to Top of Page
   

- Advertisement -