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.
Author |
Topic |
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2010-04-09 : 11:31:17
|
Hi All,i've a sqlcmd statement need to execute from command prompt. after copying and paste at the command prompt, i entered Enter. then it is giving the numbers like1>2>3>not sure how to execute. helpArnavEven you learn 1%, Learn it with 100% confidence. |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-04-09 : 11:42:05
|
at that point you need to enter some commands, for example , if you wanted the list of databases on the system , it would b something like:1>use master2>select name from sysdatabases3>goYou can see other switches by :SQLCMD -?Jack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2010-04-09 : 11:45:39
|
Hi Jack,below is the script (changed actual names)sqlcmd -S abc\ddhhgg -E:r "P:\adc\fkgsgd\Deployment\OneTime\CR\CR3334_Setup.sql"in the request, no databse name is mentioned....pls helpArnavEven you learn 1%, Learn it with 100% confidence. |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-04-09 : 15:15:10
|
HiIf you want to run the script - for example - from your command line. Do :SQLCMD -E -S abc\ddhhgg -d myDb -i "P:\adc\fkgsgd\Deployment\OneTime\CR\CR3334_Setup.sql" In the example I've posted - this would run the script on the -i switch on the database mentioned on the -d switch.Obviously , I don't know what you've got in the script , so I'm making some assumptions . Jack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|