Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Audit trail table trigger
Message
 
 
To
30/08/2006 16:25:42
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01149981
Message ID:
01150002
Views:
28
You didn't say what you want to do with them. The easiest is to skip them
		DECLARE @FieldType varchar(30)
		--select @fieldname = COLUMN_NAME 
		        --from INFORMATION_SCHEMA.COLUMNS 
			--where TABLE_NAME = @TableName and ORDINAL_POSITION = @field
	select @fieldname = COLUMN_NAME, @FieldType = DATA_TYPE 
			from INFORMATION_SCHEMA.COLUMNS 
			where TABLE_NAME = @TableName and ORDINAL_POSITION = @field
		IF @FieldType NOT IN ('image', 'text', 'ntext')
>I am trying to add the following as a trigger for my registrations table. The client would like an audit trail of all adds, edits and deletes. The code I am using was provided by the following http://www.nigelrivett.net/SQLTriggers/AuditTrailTrigger.html. This code works for all tables that do not contain a field with a text data type. When a text data type is present the message Cannot use text, ntext, or image columns in the 'insert' and 'deleted' tables. Can I modify this trigger to overcome this error? Should I do this a different way?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform