Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I close SSMS but leave a stored procedure running?

Is it possible to shut down ms sql server management studio while a stored procedure is running, without stopping the stored procedure?

like image 393
user2049945 Avatar asked Feb 07 '13 08:02

user2049945


People also ask

Will SSMS work without SQL Server?

It is possible to install SQL Server Management Studio on local machine without having other SQL Server components. Below we will demonstrate different ways to install SSMS step by step on a local machine and how to connect to the remote instance using SSMS.

How do I close SQL Server Management Studio?

On the File menu, click Close Solution.

Does stored procedure execute automatically?

A stored procedure that is set to automatic execution runs every time an instance of SQL Server is started. Blocks the execution of a batch, stored procedure, or transaction until a specified time or time interval is reached, or a specified statement modifies or returns at least one row.

Do you need go at the end of stored procedure?

It has zero impact on your stored procedure. GO separates the statements into their own batches to be run individually. Create Procedure can only be run if it's the only thing in the batch. So terminating the statement with GO before and after the Create Procedure will make sure that it can run.


2 Answers

If you mean an SP you are running within SSMS then no. Obviously closing your own SSMS won't affect SP's that are running from other users on the server.

like image 56
Janine Rawnsley Avatar answered Sep 25 '22 18:09

Janine Rawnsley


You really can't, however you can create a SQL Agent job which will execute the stored proc do you need a result set returned to you or are you updating data?

If its an update I think you're fine just running it from the agent, if not, your next simplest way to return a long running stored proc's result set would to be create an SSIS package which outputs that result set to a csv, excel doc what ever is appropriate. This package can then also be executed by the SQL Agent.

like image 26
Christopher Samulski Avatar answered Sep 23 '22 18:09

Christopher Samulski