Tuesday, July 15, 2008

Write and Execute Stored Procedures with Parameters in SQLserver

Here is an example with an input parameter,
CREATE PROCEDURE usp_findName
@LastName(50)
AS
BEGIN
SELECT LastName, FirstName WHERE LastName = @LastName
END
GO


To execute a stored procedure
usp_findName 'xu'