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

Running a SQL file from Query Analyzer 1

Status
Not open for further replies.

Lekar

Programmer
Sep 7, 2001
85
CR
Hi. I remember some years ago that ORACLE has a statement that runs a sql file. I want to do the same from Query Analyzer. I want to build another sql file like this:

ExecuteSQLFile 'C:\SQLScript1.sql'
ExecuteSQLFile 'C:\SQLScript2.sql'
ExecuteSQLFile 'C:\SQLScript3.sql'
ExecuteSQLFile 'C:\SQLScript4.sql'

Obviously 'ExecuteSQLFile' is a statement similar to the one I'm looking for. I m doing that, because I don't want to put all the sentences from the 4 files in only 1 file.

Any help would be appreciate.

[bomb] Lenin.
 
see osql in bol.
it's a command line utility so

exec master..xp_cmdshell 'osql...'

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks Nigelrivett. It works very well.

[bomb] Lenin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top