Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQLCMD not returning control Expand / Collapse
Author
Message
Posted Friday, October 3, 2008 9:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 26, 2013 3:05 AM
Points: 1, Visits: 72
Has anyone come across this?

When running sql via sqlcmd from one server against another the script runs and completes but does not return control to the calling session.

e.g. EXEC master..xp_cmdshell 'sqlcmd -E -h-1 -I -w240 -SXXXXXX -dDatabase-i "C:\Temp\test.sql"'

where XXXXXX is a different server to the one you're running the script on, and test.sql can be something as simple as 'select count(*) from dbo.table go'

Occurs from Management Studio or running sqlcmd from DOS prompt. What is even more strange is that sometimes the first execution works but subsequent ones fail.

Profiler shows query completing on target server and connection ending but control is not returned to the caller.
Post #580362
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse