Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Run a SQL file from within a batch file

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-22 : 08:36:53
kathyB writes "I am working on a data conversion effort from a goldmine sql server into a newly created (trully relational) sql server using SQL Server 7.0.

I have alot of *.sql files that I have created. I didn't want to make them stored procdures because once all these files are run, that is it. I didn't want to have to go back and delete the stored procedures.

What I would like to do (and I haven't been successful) is create jobs to run the individual sql files. Is there a SQL command to run a file(lets say it is called c:\mybatch.sql)? I tried using "xp_cmdshell" but I can't seem to get the syntax. Can anyone help me?

Thanks in advance"
   

- Advertisement -