I restored my development database from production, and the stored procedures I need in my development environment doesn't exist in my production database. Is there a command Ii can use to import the developmetn stored procedures back into SQL Server. There are about 88 files, as each procedure is in a different text file.
TIA! Chris
Oops, you did the painful way of generating scripts. You should have created a single script for all procedures by right clicking on the database in SSMS, choosing Tasks -> Generate Scripts.
However, if you don't want to go through that process again, open up a cmd shell in the folder and remember those old batch file days:
for %f in (*.sql) do sqlcmd -i %f
This should do the trick!
You could add other parameters to sqlcmd if required (i.e. login, password, server name, ...). To see a list of switches just do a sqlcmd -h
.
For SQL 2K & 2K5, you want this tool.
I asked a similar question awhile ago and got this advice from Mike L (give him votes here).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With