Click here to Skip to main content
16,002,105 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to show value of column sub for each row in table,but stored peocedure returns 0 while executing, column sub has type varchar

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[subcat]

@main varchar(max)

as
begin
select sub from category where main='@main'

end
Posted

1 solution

Remove the single quotes, use like below
SQL
select sub from category where main=@main
 
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