Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Backing up multiple stored procedures into individual text files


Backing up multiple stored procedures into individual text files

Author
Message
Noman Salim
Noman Salim
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 21
I'm using sql server 2005 and I need a way to back-up 200+ stored procedures into individual files with the same names as the stored procedures (basically a back-up of all stored procedures individually) at the same time and not one by one.

Please help.
Karthik-214069
Karthik-214069
Old Hand
Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)

Group: General Forum Members
Points: 303 Visits: 114
Right click on the database in SSMS. Go to Tasks->Generate Scripts.

Go with the defaults in the wizard till you come to the page to select object types. Select Stored Procedures. In the next screen, select Script to File -> File Per Object.

Hopefully this is what you needed!

Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36062 Visits: 18736
I'd use Karthik's solution and then be sure you get them into a version control system. Ideally you are checking them out of some SCC and then editing them before checking them back in.

If you don't have some SCC, you should get one, but at the least, zip up the procs into a file with a timestamp so you know which versions are available.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Noman Salim
Noman Salim
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 21
Karthik (12/14/2007)
Right click on the database in SSMS. Go to Tasks->Generate Scripts.

Go with the defaults in the wizard till you come to the page to select object types. Select Stored Procedures. In the next screen, select Script to File -> File Per Object.

Hopefully this is what you needed!


SWEET! This is exactly what I was looking for. My only problem was that I was trying it from my client machine and I couldn't find the 'File per Object' option. Then I logged into the DB server and there it was...

Muchas Gracias Senor!w00t
MarkusB
MarkusB
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4449 Visits: 4208
Noman Salim (12/14/2007)
Karthik (12/14/2007)
Right click on the database in SSMS. Go to Tasks->Generate Scripts.

Go with the defaults in the wizard till you come to the page to select object types. Select Stored Procedures. In the next screen, select Script to File -> File Per Object.

Hopefully this is what you needed!


SWEET! This is exactly what I was looking for. My only problem was that I was trying it from my client machine and I couldn't find the 'File per Object' option. Then I logged into the DB server and there it was...

Muchas Gracias Senor!w00t

This option was added with SP2 if I remember correctly. Most likely SP2 has been installed on the server but the client tools on your machine aren't updated. Run the service pack opn your client and you should have this option there too.

Markus Bohse
Falcon-613379
Falcon-613379
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 0
Hi ,

Very Cool, i got the answer.

ThanksSmile
HaVoK46
HaVoK46
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 55
Hi

Is there anyway to do this via TSQL?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search