How can I execute these series of commands in batch file? It only executes the first line which is the sqlcmd -S ********\SQLEXPRESS -U sa -P *****
:
sqlcmd -S ********\SQLEXPRESS -U sa -P *****
USE Database
GO
SELECT * FROM TBLPERSON
GO
How can I execute these series of commands in batch file? It only executes the first line which is the sqlcmd -S ********\SQLEXPRESS -U sa -P *****
:
sqlcmd -S ********\SQLEXPRESS -U sa -P *****
USE Database
GO
SELECT * FROM TBLPERSON
GO
You can use the following command.
SQLCMD -S <server> -d <database> -U <user> -P <password> -Q "SELECT * FROM TBLPERSON"
Check out the SQLCMD documentation for more here.