Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi

I want to create script of all procedures of a particular database
with :
SQL
"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp.Name]') AND type in (N'P', N'PC'))"
Drop procedure [dbo].[sp.Name]
Create proc [dbo].[sp.Name]

then
"Same for next procedure "

format:
In A single .sql file.
I have use so many way of doing this but I did not get
the proper format
Posted
Updated 27-Oct-12 8:30am
v2

1 solution

In your Sql Server Management Studio :

Right click on Your Database
then go to Tasks -> Generate Scripts
then Select Specific Database Objects & select Stored Procedures.

Then save it to single file.
 
Share this answer
 
v2
Comments
damodara naidu betha 29-Oct-12 6:17am    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900