March 20, 2019 at 1:48 pm
Thanks
March 20, 2019 at 2:14 pm
Maybe this?:
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
GO
ALTER Procedure [dbo].[sp_MarkAsLeaver]
@username varchar(50),
@LeaverDetails varchar(100),
@RowsUpdated int output,
@id_user varchar(50) output
AS
SET @id_user = NULL;
SELECT @id_user = id_user FROM tbl_Users WHERE username=@username
IF @id_user IS NOT NULL
BEGIN
UPDATE tbl_users SET username=@LeaverDetails WHERE username = @username
SET @RowsUpdated = @@ROWCOUNT
END /*IF*/
ELSE
BEGIN
SET @RowsUpdated = 0
END /*ELSE*/
/*end of proc*/
GO
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
March 20, 2019 at 2:28 pm
That'll do the trick :O)
Thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply