Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can one step through a script 1

Status
Not open for further replies.

pwills

Technical User
Sep 14, 2002
54
0
0
GB
I am creating a script of my entire database so I can create a dev version.

I'm a little nervous just whacking the whole script onto my dev server. Can I step through it somehow?
 
If you are in SQL 2000 there is a debugger which will allow you to step through a script. Also in Query anallyzer, you could highlight the part of the script you want to run and then execute. If you have text highlighted that is the only part that will run.
Or of course you could save the scripts as indivdual objects and then run them one at a time.
Or you could just detach the database and copy it to the development server, then attach it back to production and development. This way, you also get the data, which running the scripts won't do and it's fast.

If you are just moving to a development/production environment, I suggest you get a tool called SQL Compare. It will allow you to compare the two databases and create scripts to move the chnaged or new objects. It is a major help to me when I am moving new stuff to production. Its not foolproof, you still have to be careful what order you move things (I usually move tables first, then views, then stored procedures)and you may have to check permissions after you move things, but it really helps keep you from forgetting to move things.
 
Hi

To run a script you can open it in SQL Server Query Analyzer and run it by clicking the green arrow.

To run it bit by bit:
1 - Select the lines you want to run
2 - Click the green arrow
Only the selected lines will run

Important
=========
The script will run against the database whose name is shown in the drop-down list at the top.

Hope this helps

Regards

sadcow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top