Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 38742

SQLCMD is Microsoft SQL Server's command line utility that allows you execute T-SQL commands from a command prompt.

2 votes
1 answer
411 views

Messages in SQLCMD script output are not in order

I am running a batch file that launches a SQLCMD script that creates an Agent job from TFS Release Manager. … The script assigns SQLCMD parameters to variables, lists the variables using selects and displays some feedback in the running of the script throughout the script. …
Metaphor's user avatar
  • 906
8 votes
1 answer
7k views

Transaction with multiple SQLCMD calls in a batch file

SQLCMD -S %SERVER% -E -Q "BEGIN TRANSACTION" FOR %%f in (script1 script2 script3) do ( SET CURRENT_SCRIPT=%%f SQLCMD -S Localhost -E -b -V 1 -i %%f.sql -o %%f.log IF !ERRORLEVEL! … NEQ 0 GOTO ERROR SET CURRENT_SCRIPT= ) SQLCMD -S %SERVER% -E -Q "COMMIT TRANSACTION" …
Metaphor's user avatar
  • 906
3 votes
1 answer
1k views

Suppressing non-ANSI warnings in SQLCMD script

I am working with a script that creates a SQL Agent job in SQL Server 2014. The job's last 2 steps are "Complete with Success" and "Complete with Failure". The script always warns of non-existent step …
Metaphor's user avatar
  • 906