Showing posts with label inserted. Show all posts
Showing posts with label inserted. Show all posts

Sunday, March 25, 2012

accessing fake data inside an INSTEAD OF trigger

Hello,
Is it possible to access inserted data through an UPDATE INSTEAD OF
trigger if the condition of the query does not match any row in a
table?
For example :
UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
If there is no row inside myTable matching the condition "WHERE
myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
error but the inserted table remains empty.
Is there a way to access the value 'abc' in such a situation?
thank you
sNo, you do not have access to the originating command, nor any
parameters of that command. What you have access to are the DELETED
and INSERTED tables, and the table that was updated.
Roy Harvey
Beacon Falls, CT
On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:

>Hello,
>Is it possible to access inserted data through an UPDATE INSTEAD OF
>trigger if the condition of the query does not match any row in a
>table?
>For example :
>UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
>If there is no row inside myTable matching the condition "WHERE
>myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
>error but the inserted table remains empty.
>Is there a way to access the value 'abc' in such a situation?
>thank you
>s|||OK ... but this data should exist somewhere.
I mean if the server returns an empty cursor when I do a SELECT * FROM
INSERTED within the trigger, it is because it has access to myColumn2 =
'xyz'. Any API to access the query content, even if it does not match
anything in the table?
thank you
Roy Harvey wrote:
> No, you do not have access to the originating command, nor any
> parameters of that command. What you have access to are the DELETED
> and INSERTED tables, and the table that was updated.
> Roy Harvey
> Beacon Falls, CT
>
> On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:
>|||On 3 Mar 2006 07:30:03 -0800, "steven" <stevenshawk@.gmail.com> wrote:

>OK ... but this data should exist somewhere.
>I mean if the server returns an empty cursor when I do a SELECT * FROM
>INSERTED within the trigger, it is because it has access to myColumn2 =
>'xyz'. Any API to access the query content, even if it does not match
>anything in the table?
>thank you
Nothing like that I've ever heard of. Or imagined, for that matter.
Roy Harvey
Beacon Falls, CT

Monday, February 13, 2012

access inserted data

i have a oledb destination in my data flow pointing to table ABC and an

error output if the insert failed..follow the error output, i have a

lookup on table ABC which doesn't seem to work..is it possible to

access new data in table ABC follow the error output?

thanks

Thanh Duong wrote:

i have a oledb destination in my data flow pointing to table ABC and an error output if the insert failed..follow the error output, i have a lookup on table ABC which doesn't seem to work..is it possible to access new data in table ABC follow the error output?

thanks

No.

Push the error rows into a raw file and then do your lookup in another data flow task.

-Jamie

Saturday, February 11, 2012

Access equivalent to @@identity

Hi,
I am trying to get the id of the record that was just inserted into the table. Unfortunately, I have to use Microsoft Access and @.@.identity will not work. Is there some other command that performs the same operation? I am hesitant to use MAX().
Your comments are greatly appreciated.
Thanks.Sorry, I didn't see a forum for Microsoft Access. Maybe this topic should be moved to "Other"??|||4GuysFromRolla.com : ASP FAQS : Databases, General
How do I get the record number of a just added record, using an Access database table? by Bill Wilkinson - 11/3/2000
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79

ADO FAQ - Q9) How do I get the AutoNumber (or Identity) for a newly inserted record?
http://www.able-consulting.com/ADO_Faq.htm#Q9

INFO: Identity and Auto-Increment Fields in ADO 2.1 and Beyond
http://support.microsoft.com/support/kb/articles/q233/2/99.ASP

INFO: Identity (AutoIncrement) Columns in ADO or RDS
http://support.microsoft.com/support/kb/articles/q195/9/10.asp

User Tips: Getting the ID of the Just Inserted Database Record by Dan H. - 12/26/2000
http://www.4guysfromrolla.com/webtech/tips/t122600-1.shtml