question

sand143eep avatar image
sand143eep asked

Need to add 1,2,3,4,--- for every update

Hi Team,

I have a procedure where the requirement is when ever a user is deleted then we need to update the table with username + Deleted + 1 for the 2nd deletion

username + Deleted + 12 and so on. please help me here how can I achieve this in this following code:

               

DECLARE @userName VARCHAR(400)

SET @userName =(SELECT UserName from usertable where userno = @userno);

Update users Set UserName ='[DELETED] '+ @userName where userno = @userno;

END

SELECTISNULL(CAST(@userno ASvarchar(50)),null) userid;

END

sql-server-2008-r2sql-serversql-server-2012
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

for the 2nd deletion it should be username+deleted+2 and so on

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.