RE: Getting changed fields from database using an audit table

2007-01-10 Thread Doug Bezona
Thanks Richard - this is just what I need, but there's a small bug. The NewValue field is outputting the name of the field and not its value. T-SQL is not something I have a lot of experience with, and I've been digging through the docs to see if I can figure out a solution, but no luck so far.

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Gaulin, Mark
Try joining the two user tables rather than doing tons of single-row queries on the updated table. Unfortunately you will have to alias all of the columns from one of the tables to get unique column names. (You might do a single query of the users table that returns zero records just to get the

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Doug Bezona
: RE: Getting changed fields from database using an audit table Try joining the two user tables rather than doing tons of single-row queries on the updated table. Unfortunately you will have to alias all of the columns from one of the tables to get unique column names. (You might do a single

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Richard Kroll
In a SQL query without the dynamic column list, is this what you are trying to achieve? SELECT u.id FROMusers u INNER JOIN users_updated up ON u.id = up.id AND up.lastupdated = cfqueryparam cfsqltype=cf_sql_date value=#since# WHERE u.id IN (

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Doug Bezona
[mailto:[EMAIL PROTECTED] Sent: Tuesday, January 09, 2007 1:26 PM To: CF-Talk Subject: RE: Getting changed fields from database using an audit table In a SQL query without the dynamic column list, is this what you are trying to achieve? SELECTu.id FROM users u INNER JOIN

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Richard Kroll
PROTECTED] Sent: Tuesday, January 09, 2007 1:59 PM To: CF-Talk Subject: RE: Getting changed fields from database using an audit table Thanks Unfortunately, simply having the two tables joined doesn't help. The issue isn't getting the correct data, it's simply that to get the output I need

RE: Getting changed fields from database using an audit table

2007-01-09 Thread Doug Bezona
Thanks - I'll give that a try. -Original Message- From: Richard Kroll [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: 1/9/07 5:03 PM Subject: RE: Getting changed fields from database using an audit table Doug, After seeing your intended output the query will need to change