Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I have a stored Procedure in sql.


SQL
ALTER proc [dbo].XYZ
@EM varchar(100),@FY varchar(100),@AL numeric(18,2),
@EL numeric(18,2),@BL numeric(18,2),@OE varchar(100)
as
declare @count int
select @count=count(*) from Table1 where OE=@OE and
FY=@FY
if(@count>0)
begin
Print 'Record Already Exists'
end
else
begin
insert into Table1 (OE,FY,AL,EL,@BL,ActionDate)
values(@OE,@FY,@AL,@EL,BL,getdate())
Print 'Record Saved Successfully'
end



I want to display Print Statement in a Label in asp.net.

Please Help
Posted

Print is used for only show results in sql server messages.not get it.If you want message means get parameters to set that.
 
Share this answer
 
You need to return the text data from Stored Procedure.
Look here: MSDN: Return Data from a Stored Procedure[^]
 
Share this answer
 
v2
You also can use "output" parameter for the same.
 
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