Solved

Query Syntax not working

Posted on 2011-09-14
5
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 55

Expert Comment

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

Accepted Solution

by:
Huseyin KAHRAMAN 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 34

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

690 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