H
Hexi
Unregistered / Unconfirmed
GUEST, unregistred user!
我在sql7.0中执行下面创建触发器,出现错误
“Server: Msg 2739, Level 16, State 1, Procedure trLetter_Insert, Line 4
The text, ntext, and image data types are invalid for local variables.
”
该如何解决,我的出发器能否简化?
CREATE TRIGGER [trLetter_Insert] ON [tbLetter]
FOR INSERT
AS
begin
declare @UserID int, @RegDateTime datetime, @NeedEmail bit, @LetterID int, @Content text;
select @UserID=UserID, @RegDateTime=RegDateTime,@Content=Content, @NeedEmail=NeedEmail, @LetterID=LetterID from Inserted;
Insert tbAnswer (UserID, RegDateTime, Content, NeedEmail, LetterID);
values (@UserID, @RegDateTime, @Content, @NeedEmail, @LetterID)
end
“Server: Msg 2739, Level 16, State 1, Procedure trLetter_Insert, Line 4
The text, ntext, and image data types are invalid for local variables.
”
该如何解决,我的出发器能否简化?
CREATE TRIGGER [trLetter_Insert] ON [tbLetter]
FOR INSERT
AS
begin
declare @UserID int, @RegDateTime datetime, @NeedEmail bit, @LetterID int, @Content text;
select @UserID=UserID, @RegDateTime=RegDateTime,@Content=Content, @NeedEmail=NeedEmail, @LetterID=LetterID from Inserted;
Insert tbAnswer (UserID, RegDateTime, Content, NeedEmail, LetterID);
values (@UserID, @RegDateTime, @Content, @NeedEmail, @LetterID)
end