29 September,2015 by Tom Collins
Question: I have to execute a stored procedure for troubleshooting – but permanent stored procedures are disallowed. Is there a way to create a temporary stored procedure - ?
Answer: Yes, you can create a temporary stored procedure in SQL Server , using tempdb. There are two options. A stored procedure available only to your session and a stored procedure available to more than your session
CREATE PROC #myStoredProcedure
If another session attempts to execute the stored procedure , the user will see a “cannot find the stored procedure” message.
CREATE PROC ##ourStoredProcedure
Restrictions on compiling permanent stored procedures can be a problem – but often there a good security reasons . Speak to the DBA about other workarounds.
SQL Server - Grant execute on all stored procedures - SQL Server ...
SQL Server - Last time a stored procedure was executed - SQL ...
Xp_cmdshell – the most dangerous extended stored procedure
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |