Top "Sqlcmd" questions

SQLCMD is a command line tool used to run SQL batches on Microsoft SQL Server.

SQLCMD utility from BAT file - how to return ERRORLEVEL in case of syntax error

How can I get %ERRORLEVEL% from SQLCMD utility when some of .sql files contains syntax error? These files create stored …

sql batch-file syntax-error sqlcmd
Sqlcmd trailing spaces in output file

Here is my simplified scenario: I have a table in SQL Server 2005 with single column of type varchar(500). Data in …

sql-server-2005 sqlcmd
SET QUOTED IDENTIFIER should be ON when inserting a record

I am stuck in a rather strange problem with SQL Server 2005, which throws "SET QUOTED IDENTIFIER should be on when …

sql-server sqlcmd
How do we tell sqlcmd to continue "on error" with next batch?

Any ideas on how to accomplish this? USE [db_name] BEGIN TRANSACTION ...TONS OF INSERTS COMMIT; RAISERROR (..) WITH NOWAIT; //If …

sql sql-server sqlcmd
Docker + mssql-server-linux: How to launch .sql file during build (from Dockerfile)

I am trying to create my own Docker image with MSSQL DB for development. It's based on microsoft/mssql-server-linux image. …

sql-server docker dockerfile sqlcmd
SSDT Publish errors on Creating Publish Preview

I am using Visual Studio 2013 to manage a .sqlproj file containing our database schema. The schema has been deployed successfully …

sql-server-data-tools sqlcmd dacpac
Executing Publish Scripts with SQLCMD doesn't return

I am having an issue running SQL scripts generated by the Publish > Generate Scripts dialog on a SQL Server …

sql-server batch-file visual-studio-2013 sqlcmd
Save results to txt file without any other formatting in sqlcmd

When i run this command: sqlcmd -S server -U sa -P xxxxxxx -i d:clients.sql -o D:\clients.txt …

tsql sqlcmd osql
Running sqlcmd locally - Error Locating Server

I am trying to run a SQL script locally using sqlcmd, but I keep getting the following response: HResult 0xFFFFFFFF, …

sql-server tsql sql-server-2012 sqlcmd
Create zip file from SQL Server

Here is code which I use to create a .rar file with a password DECLARE @source VARCHAR(1000), @destination VARCHAR(1000), @Command …

sql sql-server sqlcmd xp-cmdshell