February 3, 2009 at 7:31 am
Hi,
Good evening to All.
I have a query regarding execution of a batch file from DOS prompt.
I have a batch file as follows.
@ECHO off
cls
:start
goto CONNECT
:CONNECT
sqlcmd -S IP address,port -U username -P password -q "query"
goto END
:END
I am able to get the answer when I am running the batch file but not able to get out of sqlcmd prompt automatically. If I am giving quit command manually. I am getting out.
Please let me know how to QUIT command in the batch file.
Thanks,
Venu.
February 3, 2009 at 8:11 am
sqlcmd -S IP address,port -U username -P password -Q "query"
Notice the captial "Q" - this will run the command and quit.
February 3, 2009 at 8:20 am
Hi ,
Thanks for the response .capital 'Q' worked for me.
Thanks,
Venu.
February 3, 2009 at 8:28 am
HI,
Can you give me an example how to run a batch of sql statements(not stored procedure..),using a batch file?
Thanks,
venu
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply