Results 1 to 2 of 2

Thread: Simple Script - New to SQL

  1. #1
    Join Date
    Nov 2013

    Simple Script - New to SQL


    I want to make a simple script to move a document from a particular sub-org to another sub org. I wrote it:

    UPDATE OnboardingPackage
    SET OrganizationId = GTP.OrganizationID
    FROM GO_Demo.dbo.OnboardingPackage OP INNER Join GO_Demo.dbo.OnboardingPackage GTP ON GTP.Id = OP.Id
    WHERE (GTP.OrganizationId NOT IN ('71E1E177-4621-4AB6-8145-07B506ABDFFC', '7F1BDC6F-CFF9-4181-85F4-AFD223EC51D8'))

    but am getting an error:

    Msg 8154, Level 16, State 1, Line 1
    The table 'OnboardingPackage' is ambiguous.

    I've never written one of these before, but I thought it might make my job a bit simpler if I created one.

    What am I doing wrong?

    Thank you in advance.


  2. #2
    Join Date
    Nov 2013
    Guess it's not so easy! Thanks anyway!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts