SQLCMD
-S <serverName>
-U sa -P <password>
-d <DatabaseBase>
-Q "select top(1) * from table order by 1 desc"
-o "new.propertie"
When i am using the instead of it is not working
Variable i created
:setvar servaername "ServerName"
SQLCMD
-S <serverName>
-U sa -P <password>
-d <DatabaseBase>
-Q "select top(1) * from table order by 1 desc"
-o "new.propertie"
When i am using the instead of it is not working
Variable i created
:setvar servaername "ServerName"
I think your issue could be that variable names are case sensitive. You have "serverName" and "ServerName", in your example.
https://msdn.microsoft.com/en-us/library/ms162773.aspx
Variable names are case insensitive.