Thursday, 7 March 2013

MSSQL Check if Stored Procedure Exists

if Exists(SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'sp_MyStoredProcedure') AND type in (N'P', N'PC'))
begin
    exec sp_MyStoredProcedure
end

No comments:

Post a Comment