user
user

Reputation: 61

Stored procedure

I have one input parameter categoryid.

I want to create a stored procedure for categoryfetch with this input parameter. I have a table category with columns categoryid, shopid, title, logicalcode.

Can any one tell the stored procedure for category fetch with one input parameter?

Upvotes: 0

Views: 223

Answers (2)

deepak_pal
deepak_pal

Reputation: 159

create procedure categoryfetch @categoryid int
as select shopid,title,logicalcode from category where categoryid=@categoryid end

for execute it

exec categoryfetch @categoryid=categoryid

Upvotes: 0

Jeffrey L Whitledge
Jeffrey L Whitledge

Reputation: 59463

create procedure categoryfetch 
    @categoryid int
as
    select categoryid, shopid, title, logicalcode 
    from category 
    where categoryid = @categoryid
go

Upvotes: 2

Related Questions