September 5, 2003 at 3:01 am
Dear All,
We have a requirement to read and execute .sql files, what is the best way of doing this. If possible could you please include code ?
Thanks
Julie
September 5, 2003 at 3:05 am
Hi Julie
quote:
We have a requirement to read and execute .sql files, what is the best way of doing this. If possible could you please include code ?
how do you want to execute *.sql files?
- via QA?
- via T-SQL?
- via OSQL?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
September 5, 2003 at 3:13 am
Thanks for your reply Frank.
Using a vb application we want to create a file.
This file contains the name of the .sql script to be run. The reason we are doing it like that is we want to create these on a nightly basis dynamically.
So I assume we want to do it through T-SQL, as the file can them be picked up and activated by SQL Agent.
Thanks
Julie
September 5, 2003 at 3:29 am
quote:
Using a vb application we want to create a file.This file contains the name of the .sql script to be run. The reason we are doing it like that is we want to create these on a nightly basis dynamically.
So I assume we want to do it through T-SQL, as the file can them be picked up and activated by SQL Agent.
What about using the OSQL utility within a stored procedure and call it with xp_cmdshell?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
September 5, 2003 at 3:34 am
Thanks Frank,
And how would I do that ?
Julie
September 5, 2003 at 3:49 am
quote:
Thanks Frank,And how would I do that ?
running an 'OSQL' search on this site will get you several intersting articles on using OSQL.
If that's not enough, here's another one.
http://www.sqlteam.com/item.asp?ItemID=744
HTH
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply