Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2012-04-23 : 11:11:17
|
i cant seem to find out how to return a boolean true after a successful update:ALTER PROCEDURE [dbo].[usp_COR_upd_tblCORPerson_DotMailerID]( @PersonId INT, @DotMailerID INT)AS -- Insert statements for procedure hereSET NOCOUNT ON UPDATE dbo.tbl_COR_Person SET DotMailerID = @DotMailerID WHERE PersonId = @PersonId |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-23 : 11:16:53
|
just add a check likeALTER PROCEDURE [dbo].[usp_COR_upd_tblCORPerson_DotMailerID]( @PersonId INT, @DotMailerID INT)AS -- Insert statements for procedure hereSET NOCOUNT ON UPDATE dbo.tbl_COR_Person SET DotMailerID = @DotMailerID WHERE PersonId = @PersonIdIF @@ERROR =0 RETURN 1ELSE RETURN 0GODECLARE @Ret intEXEC @Ret= usp_COR_upd_tblCORPerson_DotMailerID value1,value2IF @Rec=1 PRINT 'Update Success'ELSE PRINT 'Update Failure' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2012-04-23 : 11:18:05
|
| great thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-23 : 11:22:02
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|