|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
simple .sql questionhi all,
how can i call a .sql script from the Query Analyzer? I know I can open the script and run it. I want to test a my code but need to initialize the tables everytime (which is what the .Sql script is doing) i run it. so i was hoping to be able to call the script from within another script, similar to: exec mystoredproc go -- my codes here go Have a look at osql in Books Online. Once you get a working command line
version of your script, use EXEC master..xp_cmdshell 'osql ...' Show quote "Amil" <A***@discussions.microsoft.com> wrote in message news:0140740F-E8A5-4B54-8016-93BA8A508C75@microsoft.com... > hi all, > how can i call a .sql script from the Query Analyzer? I know I can open > the > script and run it. I want to test a my code but need to initialize the > tables everytime (which is what the .Sql script is doing) i run it. so i > was > hoping to be able to call the script from within another script, similar > to: > exec mystoredproc > go > -- my codes here > go thanks. will check it out
Show quote "Aaron Bertrand [SQL Server MVP]" wrote: > Have a look at osql in Books Online. Once you get a working command line > version of your script, use EXEC master..xp_cmdshell 'osql ...' > > > > > "Amil" <A***@discussions.microsoft.com> wrote in message > news:0140740F-E8A5-4B54-8016-93BA8A508C75@microsoft.com... > > hi all, > > how can i call a .sql script from the Query Analyzer? I know I can open > > the > > script and run it. I want to test a my code but need to initialize the > > tables everytime (which is what the .Sql script is doing) i run it. so i > > was > > hoping to be able to call the script from within another script, similar > > to: > > exec mystoredproc > > go > > -- my codes here > > go > > > |
|||||||||||||||||||||||