Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

TABLE COPY VIA SQL

Posted on by Microsoft Employee

Is it possible to Copy over  PurchaseOrderEntry via SQL to Another Database on the Server

Note Both are functional and working, Using names Database as Reference

I tried a command as 

USE DATABASE2
GO

INSERT INTO PurchaseOrderEntry

SELECT *
FROM DATABASE1.DBO.PurchaseOrderEntry

Results

Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'PurchaseOrderEntry' can only be specified when a column list is used and IDENTITY_INSERT is ON.

Then tried

USE DATABASE2
GO
SET IDENTITY_INSERT PurchaseOrderEntry ON
INSERT INTO PurchaseOrderEntry
SELECT *
FROM DATABASE1.DBO.PurchaseOrderEntry

 

Results

Msg 8101, Level 16, State 1, Line 2
An explicit value for the identity column in table 'PurchaseOrderEntry' can only be specified when a column list is used and IDENTITY_INSERT is ON.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: TABLE COPY VIA SQL

    I have, but it still came up with the error

  • Suggested answer
    Mohammed ElQadi Profile Picture
    Mohammed ElQadi 130 on at
    RE: TABLE COPY VIA SQL

    Try

    SET IDENTITY_INSERT PurchaseOrderEntry OFF

    first

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: TABLE COPY VIA SQL

    Ok but someone edit the values it seem i believe that they performed

    UPDATE PurchaseOrderEntry

    SET PurchaseOrderID = '5606'

    Because all the Purchase Order were not blank and all the when analyzing the tables discovered the PurchaseOrderEntry  PurchaseOrderID were all 5606 the data in the PO are all blank

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: TABLE COPY VIA SQL

    the error message is telling you that you can't insert values into the IDENTITY field.  This field will self generate a value.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans