Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

procedure error

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
hi friends
i have created proced like this

create procedure gldnew
@item int,@qty int,@rate int
as
declare @m int
select @m=item_code from stock where item_code=@it
if @m is null
print('not found')
else
print('found')


its give erro i have to check item code is exists or not

thanks
m.a.khaleel
 

Do this instead.

If Exists (select * from stock where item_code=@it)
print('found')
Else
print('Not found')
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top