![]() For more information regarding all the various columns that can be included in the data check out the Microsoft Docs page. There is a ton of great information you can glean from the sys.dm_exec_procedure_stats DMV. DROP TABLE tmpTable Pretty ugly, but it works. ![]() SELECT FROM tmpTable - Drop the temporary table. INSERT INTO tmpTable EXECUTE MyStoredProc MyParameters - Print out the data from the stored procedure. In this example I am looking for the last execution time of a procedure named USP_POINVOIC_INS. Use MS SQL Insert Into syntax to insert the results of the stored procedure into the temp table. This can be useful information when researching performance issues.Īfter running the script the results should look similar to the following screenshot. ![]() You can optionally declare one or more parameters in a create procedure statement. The type_desc column includes the object type while the execution_count column shows the number of times the stored procedure has been executed since it was last compiled. A parameter is an argument to a stored procedure. In addition to including the procedure name and last_execution_time I have also included type_desc and execution_count columns in this script. I can run queries against certain views, but I cannot seem to execute a stored procedure this way. I have a linked server connecting to a Sybase 11 database that works fine. WHERE DB_NAME(s.database_ID) = '' -Database Name I have read the previous threads but Im not getting any successusing sql sever 2008 r2. INNER JOIN sys.objects o ON s.object_id = o.object_id
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |