Unix Technical Forum

Problem with trigger

This is a discussion on Problem with trigger within the SQL Server forums, part of the Microsoft SQL Server category; --> Im having problems with an after insert trigger... Im trying to join the INSERTED table with other tables to ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 12:53 PM
Jimbo
 
Posts: n/a
Default Problem with trigger

Im having problems with an after insert trigger...

Im trying to join the INSERTED table with other tables to retrieve
data....Some of these tables it must link to get data inserted into
them at the same time my original table does...my question is why when
the trigger runs, my sql statement gets no data...however afterwards if
I run the statement and use the primary key that was just inserted, the
statement brings up data?..

I hope I was clear enough..

-Jim

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 12:53 PM
Hugo Kornelis
 
Posts: n/a
Default Re: Problem with trigger

On 21 Dec 2006 09:26:27 -0800, Jimbo wrote:

>Im having problems with an after insert trigger...
>
>Im trying to join the INSERTED table with other tables to retrieve
>data....Some of these tables it must link to get data inserted into
>them at the same time my original table does...my question is why when
>the trigger runs, my sql statement gets no data...however afterwards if
>I run the statement and use the primary key that was just inserted, the
>statement brings up data?..
>
>I hope I was clear enough..


Hi Jim,

No, you were not.

Please post CREATE TABLE statements to reproduce your tables (you may
omit irrelevant columns, but please do include all keys, properties, and
indexes), the CREATE TRIGGER statement with your current, non-working
trigger code, some INSERT statements with sample data, the expecte
results and the results yoou are actuallly seeing. That allows us to
reproduce your problem by cut and paste, and to test if our suggestions
match the desired resuls.

--
Hugo Kornelis, SQL Server MVP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:56 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com