Sql-server – SQLCMD stuck on “set textsize 4096”

sql serversql-server-2012sqlcmd

I am using SQL Data Compare to generate a script that updates data in a QA database (SQL Server 2012).

The script is around 500mb and I added a GO every 100 lines.
When I start the script with:

sqlcmd -E -S [server] -d [db] -i "[path to file]" 

the connection is made but it is stuck on the first sql query made by sqlcmd and not the script with the error message:

SET TEXTSIZE 4096

I tried to let it run one afternoon just to see if I get an error or a timeout etc but I get nothing it just get stuck on it. All I can do is stop sqlcmd (CTRL+C in the console).

error message screen shot

I tried with Management Studio 2008 and 2012.

Does anyone have an idea why I get this error?

Update :
I tried running it with the -o but nothing was written to the file even after 3 hours.
These are the first lines of the generated script :

SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS, NOCOUNT ON
GO
SET DATEFORMAT YMD
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
-- Pointer used for text / image updates. This might not be needed, but is declared here just in case
DECLARE @pv binary(16)
[delete update or insert...]

Best Answer

I see in your script, there is a

BEGIN TRANSACTION

and followed by delete/insert/update. I guess if you have a big volume change, this transaction may take longer depending on your destination db's status, such as whether there is conflicting sessions blocking your current session, or your destination db's log file growth is set to 1024KB. So I'd suggest that you can start Profiler to check which sql statement is started, and also check whether there is any blocking issue.