patternsqlMinor
Are there any way to stop typing 'go' in sqlcmd?
Viewed 0 times
areanywaystoptypingsqlcmdthere
Problem
If I remember correctly, last time
However, currently, we need to type the
So, are there other alternative such that when we hit Enter key after ending the command with ';', it will Execute the command?
Microsoft Sqlcmd require each command to end with ';' and hit Enter key to execute the command.However, currently, we need to type the
GO each time to execute the command.So, are there other alternative such that when we hit Enter key after ending the command with ';', it will Execute the command?
Solution
No, you need to type a batch separator. The default is
For example:
hit enter
hit enter
This will run.
Can't get rid of the intermediate enter for you. Sorry.
GO. However, you can change that by using the -c switch.For example:
C:\>sqlcmd -SServername -cFOO1> select @@versionhit enter
2> FOOhit enter
This will run.
Can't get rid of the intermediate enter for you. Sorry.
Context
StackExchange Database Administrators Q#23259, answer score: 8
Revisions (0)
No revisions yet.