我正在使用2005年SQ服务器进行触发工作。 我有一份更新后的表格。 在宣布变数后,该法典就是这样。
if @isconfirmed_before = 0 and @isconfirmed_after = 1
begin
if @invite_userid <>
begin
select @points = points from dbo.InvitePoint where code = USR and packageid = @packageid
INSERT INTO InviteCount
([userID]
,[joinMerchantID]
,[packageID]
,[points]
,[joinDate])
VALUES
(@invite_userid
,@merchantid
,@packageid
,@points
,getdate())
end
SET @alpha_numeric=
SELECT @alpha_numeric=@alpha_numeric+CHAR(n) FROM
(
SELECT TOP 8 number AS n FROM master..spt_values
WHERE TYPE= p and (number between 48 and 57 or number between 65 and 90)
ORDER BY NEWID()
) AS t
update merchant
set reg_code = @alpha_numeric
where merchantid = @merchantid
END
第一部分
update merchant
set reg_code = @alpha_numeric
where merchantid = @merchantid
只有在插入行文时,才能插入这一条码,但每当表格有更新时,它都会发生变化。 如何做到这一点。 请帮助我,事先感谢你!