Contents
How do I find the last modified view in SQL Server?
How to determine the last modified date of tables in SQL Server Instance
- t.[name] AS [UserTableName], [create_date] AS [CreatedDate], [modify_date] AS [ModifiedDate]
- t.[name] AS [UserTableName], [create_date] AS [CreatedDate], [modify_date] AS [ModifiedDate]
- t.[name] AS [UserTableName], [create_date] AS [CreatedDate],
How do I find the last execution of a stored procedure in SQL Server?
7 Answers
- Run a profiler trace with, say, the stored proc name.
- Add a line each proc (create a tabel of course) ” INSERT dbo.SPCall (What, When) VALUES (OBJECT_NAME(@@PROCID), GETDATE() “
- Extend 2 with duration too.
Why do we need stored procedures?
A stored procedure provides an important layer of security between the user interface and the database. It supports security through data access controls because end users may enter or change data, but do not write procedures. It improves productivity because statements in a stored procedure only must be written once.
Where to find last modified date of stored procedures in SQL Server?
Fortunately, finding the last modified date of stored procedures in SQL server using meta data tables is quite easy. We can do this by query SQL Server’s meta data tables, which store information about an object’s modification. Two of the commonly used meta data tables are sys.objects and sys.procedures.
How to execute modified version of stored Proc?
The script below executes the altered version of the uspMyFifthStoredProcedure stored procedure from the preceding example twice. After each time the stored procedure is run, the script queries an inner join of the sys.dm_exec_procedure_stats dynamic management view and the sys.objects catalog view.
How are stored procedures identified in SQL Server?
It is also relevant to recall that stored procedures reside in a database. Therefore, a stored procedure within SQL Server instance is uniquely identified by the combination of database name, schema name, and object name. The following script demonstrates one approach for enumerating the names of stored procedures in a database.
Is it possible to check modify date in SQL Server 2000?
I found that in SQL Server 2000 it wasn’t possible to check modify date ( look at this post: Is it possible to determine when a stored procedure was last modified in SQL Server 2000?) Is it possible to check it in SQL Server 2008? Does MS add some new feature in system tables that allow to check it?