Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Anyway to use text or ntext in a trigger!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-28 : 09:27:42
Wayne Johnson writes "Create Trigger tblHotelInfo_DescriptionChange
On dbo.tblHotelInfo
For Insert, Update
As
Declare @hotelid as int, @oldvar as nvarchar(50), @newvar as nvarchar(50)

Set @hotelid = (Select HotelID From INSERTED);
Set @hotelid = (Select HotelID From DELETED);
Set @oldvar = [ntext_field]

INSERT INTO tblFieldLog (IID, Field, OldValue) VALUES (@hotelid, 'Description', @oldvar);

Any ideas or you may have answer already on your site but can't find!"
   

- Advertisement -