Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Audit trail table trigger
Message
 
 
À
30/08/2006 16:25:42
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01149981
Message ID:
01150002
Vues:
29
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform