How to check if a stored procedure or query is saved in SQL Server?
Ideas
I would prefer a solution that can be included as a stored procedure with procedure_name and / or pid , parameters as input, so tracing programs or solutions using the SQL Server interface will not work.
Update # 1
Usage example:
CREATE PROCEDURE dbo.sp_sleeping_beauty @time_str varchar(50) AS SET NOCOUNT ON; WAITFOR DELAY @time_str; GO dbo.sp_sleeping_beauty '00:00:10' dbo.sp_sleeping_beauty '00:00:20' dbo.sp_sleeping_beauty '00:00:30'
the procedure should be called as
test_if_running 'dbo.sp_sleeping_beauty '00:00:20''
and return true during operation (within 20 seconds) and false after or if the function fails or system reboots
sql sql-server stored-procedures
Stefan rogin
source share