Solved

Query Syntax not working

Posted on 2011-09-14
5
309 Views
Last Modified: 2012-05-12
Hi,

I am trying to copy data from one SQL 2005 db server table to another but no luck.  Please tell me what I am doing wrong.

Inset Query
INSERT INTO [AUTOCAD].[GP_0009].[GP_REVISION]
                      (EMPL, GP_SCHEDULE, YEAR, PERIOD, REVISION, SIGN, SIGN, FL, APP, APD, MB, RW, TIME, NOTES)

SELECT     EMPL, GP_SCHEDULE, YEAR, PERIOD, REVISION, SIGN, SIGN, FL, APP, APD, MB, RW, TIME, NOTES

FROM         [AUTOCAD].[dbo].[GP_REVISION_TEST]


Error
Msg 40002, Level 16, State 1, Procedure GP_REVISION_INSTRIG, Line 36
NOT IN GP for child GP_REVISION
Msg 3609, Level 16, State 1, Line 1
The transaction ended in the trigger. The batch has been aborted.


0
Comment
Question by:cesemj
  • 2
  • 2
5 Comments
 
LVL 51

Expert Comment

by:HainKurt
ID: 36538625
you have a trigger on [AUTOCAD].[GP_0009].[GP_REVISION] which causes some errors...
0
 
LVL 51

Accepted Solution

by:
HainKurt earned 250 total points
ID: 36538631
nothing wrong on the query.... either disable/delete the trigger or try to understand the logic in trigger and identify the offensive record and filter them out in your insert/select query...
0
 
LVL 33

Assisted Solution

by:Norie
Norie earned 250 total points
ID: 36538655
Do you know if there is a procedure called GP_REVISION_INSTRIG?

That's appears to be triggered by your query, or something in the query.

It's probably the INSERT that's doing that.

Pretty hard to tell what the specific problem is without knowing more.

You might be able to disable the trigger causing the error but that might have other implicationa.
0
 

Author Comment

by:cesemj
ID: 36538759
ok I will try to understand the logic in trigger  and will let you know what happens.
0
 

Author Closing Comment

by:cesemj
ID: 36549718
Thank you again.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question