|
---- Drop stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
AND SPECIFIC_NAME = N'mySP'
)
DROP PROCEDURE dbo.mySP
GO
---- Create Stored Procedure
CREATE PROCEDURE dbo.mySP
@p1 int = 0,
@p2 int = 0
AS
SELECT @p1, @p2
GO
---- Execute the Stored Procedure
EXECUTE dbo.mySP 1, 2
GO
|