昨天用到了这个功能,顺便写下来,以便以后忘了拿来用...
增加触发器,代码如下...
CREATE TRIGGER tLogUpdate ON [dbo].[tLog]
FOR INSERT
AS
update tLog Set fID=(select max(fID) as fID from tlog) + 1 where fID=0
前提:fID字段为Numeric,默认值为:0
昨天用到了这个功能,顺便写下来,以便以后忘了拿来用...
增加触发器,代码如下...
CREATE TRIGGER tLogUpdate ON [dbo].[tLog]
FOR INSERT
AS
update tLog Set fID=(select max(fID) as fID from tlog) + 1 where fID=0
前提:fID字段为Numeric,默认值为:0