March 9, 2007 at 4:45 pm
I'd like to automatically save a copy of data into a historical table automatically if someone changed my data. I think of using trigger; however, the deleted and updated in trigger will not allow any text field. Is there anyway to go over this? I'm really stuck. Please help.
Thanks
Minh
March 9, 2007 at 9:37 pm
I think that the instead of triggers let you access those datatypes, but I have never done that so I could use a confirmation on this one.
March 10, 2007 at 5:48 am
You may copy data from static table, not from DELETED.
INSERT INTO dbo.AuditTable (ID, Col1, TextCol)
SELECT d.ID, D.Col1, T.TextCol
FROM deleted D
INNER JOIN dbo.MyTable T ON D.ID = T.ID
But it must be INSTEAD OF trigger.
_____________
Code for TallyGenerator
March 11, 2007 at 12:58 pm
Personally, I'd hunt down and shoot the bugger that put a Text column in the database in SQL Server 2000.
Also, why the heck do you need to audit a Text column? What are you storing in it?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply