CREATE PROC Member_UpdateTags ( @ID INT, @Tags NVARCHAR(20), ) BEGIN //根据传进来的这个ID和tags来增加这个人的tags, END
------解决方案--------------------
SQL code
CREATE PROC Member_UpdateTags
(
@ID INT,
@Tags NVARCHAR(20)
)
AS
BEGIN
if exists(select 1 from tb WHERE id=@ID )
UPDATE dbo.tb SET Tags=Tags+','+@Tags WHERE id=@ID
ELSE
INSERT INTO tb VALUES(@ID,@Tags)
END