Solved

Query Syntax not working

Posted on 2011-09-14
5
306 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.‚Äč
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now