Quantcast
Channel: Answers for "Create trigger for all tables in a DB"
Browsing latest articles
Browse All 4 View Live

Answer by Cyborg

Why do you want to do this with trigger? DEFAULT value will work. Assign default value getdate() for both columns, when you do inserts both columns will get the default value.

View Article



Answer by ecomma

EXEC sp_MSforeachtable 'IF NOT EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N''?_Update_DateCreated_DateModified'')) EXEC dbo.sp_executesql @statement = N''CREATE TRIGGER...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images