May 20, 2012 at 3:56 am
I have just starting using MS SQL Server.
I want to create a DDL trigger. The idea is as follows:
I have a table named DefaultValues with these columns:
DefaultValueID,
TableName,
ColumnName,
ColumnValue
The table is used to store default values for other tables
To obtain integrity the idea is to have a trigger(after update) to catch if a column in a table changes name and then change the values in the ColumnName accordingly.
Can some of you clever people assist me in my first efforts to create such a trigger
May 20, 2012 at 7:39 am
Here is some info with examples (sample code) of what I think you want to accomplish.
May 20, 2012 at 7:52 am
You know, You could also just use use a View that remaps the Table Default information already stored in the database's metadata and presents it in the same format as your table. No triggers would be needed then.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy