469,645 Members | 1,685 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Data Table Column Order

I am attempting to use triggers to add some simple auditing to my database structure (SQL Server 2005). I am running an ASP with this so I have many databases (dozens) with identical structure. My problem is that as we create new databases and tables, we have never paid attention to column ordering. Who cares right? Well triggers seem to care if you need it to key off a change in a specific column in a specific data table. I do not see any option other than to reference the columns ordinally. If the column order is different from datatable to datatable even though the column are the same, I am screwwed. I will need custom triggers for each database and then I am better off writing code. That has more overhead than I want to introduce though.

The question is: Is there a way to get a trigger to fire off an update on a column name rather than it's ordinal location in the table. If not is there a way via SQL script I can force column ordering? That seems silly to have to do and will make adding fields later a bear. Are triggers just not fully developed? Ordinal referencing is dangerous in my case.
Jul 13 '07 #1
0 1475

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by Fawke101 | last post: by
2 posts views Thread by William Cleveland | last post: by
4 posts views Thread by teddysnips | last post: by
5 posts views Thread by uthuras | last post: by
1 post views Thread by Andrew Arace | last post: by
2 posts views Thread by Tilted | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.