-
ADO, SQL Server Batch files
Is there a function in T-SQL similar to Sybase's "READ" where an SQL Batch file is read and the statments are executed from the file? Right now I have all my database scripts hard coded in a VB application. I would like to remove it and just read a text file instead. PLEASE HELP
For example "READ c:myFile.sql"
contents of myFile.sql:
CREATE DATABASE .....
CREATE Stored Procedure .....
-
ADO, SQL Server Batch files (reply)
You can use OSQL from the command prompt.
I.E.
CREATE PROCEDURE
AS
EXEC Master..XP_CmdShell 'OSQL {all the switches/path, etc...)'
Something similar to that.
-HTH -
------------
MCnKC at 5/8/01 5:08:03 PM
Is there a function in T-SQL similar to Sybase's "READ" where an SQL Batch file is read and the statments are executed from the file? Right now I have all my database scripts hard coded in a VB application. I would like to remove it and just read a text file instead. PLEASE HELP
For example "READ c:myFile.sql"
contents of myFile.sql:
CREATE DATABASE .....
CREATE Stored Procedure .....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|