venug.reddy
SSC Rookie
Points: 33
More actions
February 4, 2009 at 12:10 am
#103674
Hi,
Can you give me an example how to run a set of sql statements(not stored procedure..),using a batch file?
Thanks,
venu
Old McDonald
SSCertifiable
Points: 5768
February 4, 2009 at 12:25 am
#937738
Save the SQL statements in a .sql file and use SQLCMD.EXE to execute this file from the batch file
-Vikas Bindra
February 4, 2009 at 1:08 am
#937742
I am connecting to the SQL server as follows.
In a batch file I have written as follows.
sqlcmd -s ip,port -U usename -P passwrd -Q "Query"
can you tell me where and how to include .sql file.
- Venu
February 4, 2009 at 1:39 am
#937751
sqlcmd -s ip,port -i [file path] -U usename -P passwrd -Q "Query"
February 4, 2009 at 3:06 am
#937781
Thanks. I am able to call .sql file.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply