Click here to Skip to main content
15,888,208 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hai i am new .net developer. what my problem i wrote a stored procedure for getting data from some table my procedure i like this
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE SP_GetSubscriptionDetails
                                        (@State_ID NVARCHAR(5)
                                        ,@Disrict_ID NVARCHAR(5)
                                        ,@Name NVARCHAR(50)
                                        ,@Status NVARCHAR(1))
AS
BEGIN
    SELECT * FROM tablename WHERE cname LIKE COALESCE(cname,'')
                                    AND Disrict_ID LIKE COALESCE(@Disrict_ID,'%%')
                                    
END


but i dont know how i can i run this stored procedure

can any one plz help me
Posted

1 solution

EXECUTE SP_GetSubscriptionDetails 'State', 'District', 'Name', 'Status'

Should do the trick. As a best practice try not to name a stored procedure with SP think about usp.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900