Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In SQL Server Management Studio, is there any way (for example a SQLCMD command or something) to get the SQL script window to automatically disconnect as soon as the query has finished executing?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Easy one ...

Think about why do you want to do it ? Any specific reasons ?

From BOL :

To change the options for the current queries, click Query Options on the Query menu or the shortcut menu of the SQL Server Query window. Under Execution, click Advanced.

Disconnect after the query executes

When this check box is selected, the connection to SQL Server is terminated after the query completes. This check box is cleared by default.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.