Is it possible to shut down ms sql server management studio while a stored procedure is running, without stopping the stored procedure?
是否可以在存储过程运行时关闭ms sql server管理工作室,而无需停止存储过程?
3 个解决方案
#1
5
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.
如果你的意思是你在SSMS中运行SP,那么没有。显然关闭自己的SSMS不会影响从服务器上的其他用户运行的SP。
#2
3
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?
你真的不能,但你可以创建一个执行存储过程的SQL代理作业你需要一个返回给你的结果集还是你更新数据?
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.
如果它是一个更新,我认为你只是从代理运行它,如果没有,你的下一个最简单的方法来返回一个长期运行的存储过程的结果集将创建一个SSIS包,将该结果集输出到csv,excel doc什么是合适的。然后,此包也可以由SQL代理执行。
#3
0
Yes you can, but you will not be able to see the result of the SP if something is returned. Once the execution is given to server the server will execute the SP not the SSMS.
是的,你可以,但如果返回某些内容,你将无法看到SP的结果。一旦执行到服务器,服务器将执行SP而不是SSMS。
#1
5
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.
如果你的意思是你在SSMS中运行SP,那么没有。显然关闭自己的SSMS不会影响从服务器上的其他用户运行的SP。
#2
3
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?
你真的不能,但你可以创建一个执行存储过程的SQL代理作业你需要一个返回给你的结果集还是你更新数据?
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.
如果它是一个更新,我认为你只是从代理运行它,如果没有,你的下一个最简单的方法来返回一个长期运行的存储过程的结果集将创建一个SSIS包,将该结果集输出到csv,excel doc什么是合适的。然后,此包也可以由SQL代理执行。
#3
0
Yes you can, but you will not be able to see the result of the SP if something is returned. Once the execution is given to server the server will execute the SP not the SSMS.
是的,你可以,但如果返回某些内容,你将无法看到SP的结果。一旦执行到服务器,服务器将执行SP而不是SSMS。