Re: Logging deletes...
From: Chris Marsh (cmarsh_at_synergy-intl.com)
Date: 11/15/04
- Next message: Brian Moran: "Re: Warning: The join order has been enforced because a local join hin"
- Previous message: Anith Sen: "Re: Passing table and column names as parameters"
- In reply to: Hugo Kornelis: "Re: Logging deletes..."
- Next in thread: Adam Machanic: "Re: Logging deletes..."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Nov 2004 10:22:29 -0500
Hugo,
THANK YOU! This appeared to work - I guess walking away from it for while I
found my mistake. This solution is perfect for my clients now I need to
establish one for auditing edits. My next hurdle:-)
Have a great day!
Chris
"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
news:trjap09lre6kej0t0jjipnrnqr373ut0pq@4ax.com...
> On Fri, 12 Nov 2004 18:51:42 -0500, Chris Marsh wrote:
>
>>Hugo, what am I missing? This doesn't appear to be working and here is
>>what
>>I get once I add the getdate() value to the select line:
>>
>>Error 121: The select list of the INSERT statement contains more items
>>than
>>the insert list. The number of SELECT values must match the number of
>>INSERT columns.
>
> Hi Chris,
>
> Did you use the code as I posted it? That is
>
>>>INSERT INTO delcustomer (cusid, ..., del_datetime, del_user, del_host)
>>>SELECT cusid, ..., getdate(), suser_sname(), host_name()
>
> Note - there is a column list after INSERT INTO, that was not present in
> the code you posted earlier. I added it. You should too. Make sure that
> you include all columns that you want to give a value. (If you don't want
> to type it, you can drag the column list from the object browser into
> Query Analyzer's main screen - use F8 to open the object browser).
>
> Note - the column list after SELECT should match the column list after
> INSERT INTO. If the column names in delcustomer match the column names in
> customer, you can just copy the list. Then remove del_datetime, del_user,
> del_host (as they are not in the customer table) and replace them with
> getdate(), suser_same(), host_name().
>
> If you still get an error, post the code here. Or better yet: post full
> information: see www.aspfaq.com/5006.
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Brian Moran: "Re: Warning: The join order has been enforced because a local join hin"
- Previous message: Anith Sen: "Re: Passing table and column names as parameters"
- In reply to: Hugo Kornelis: "Re: Logging deletes..."
- Next in thread: Adam Machanic: "Re: Logging deletes..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|