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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing batch SQL scripts with "GO" statements

Status
Not open for further replies.

djjd47130

Programmer
Nov 1, 2010
480
0
0
US
We have a large software package which we execute MSSQL database updates via OSQL (command line). This is because we have not yet found a component or anything which can recognize the 'GO' statement. 'GO' makes sure all previous commands have finished executing before it continues to the next batch of commands.

I'm thinking the best thing to do is to break down these script files wherever it has 'GO' and execute batch by batch. It's sloppy the way we do it now, because the OSQL command saves an output file, which we have to manually read and try to determine if there are any errors.

Someone please advise if there is an easier way to execute large SQL scripts to update a large database with the 'GO' statement at least 100 times in the script.


JD Solutions
 
Actually, the best understanding equivalent to the GO statement is like in Delphi the 'Application.ProcessMessages' command, which makes sure all windows messages and commands are finished before the code continues. Same concept.

JD Solutions
 
proceed as you said, execute batch by batch.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top