troubleshooting Question

insert a column record within the same table between two "identical" records

Avatar of al4629740
al4629740Flag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2008
4 Comments1 Solution397 ViewsLast Modified:
I have a table named frmRegistrationCSW.

I copied a group of records in the table to make duplicate records.  When I did so I made a mistake and one of the columns did not get copied over.  The column is named 'Sector'  To fix the problem I setup the following code, but I know there are some issues.  I get the error:
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "R14.Sector" could not be bound.

Help please!

UPDATE frmRegistrationCSW
SET R14.Sector = R13.Sector
   FROM frmRegistrationCSW AS R13
   INNER JOIN frmRegistrationCSW AS R14
      ON R13.frmRegistrationCSWText2 = R14.frmRegistrationCSWText2
      AND R13.frmRegistrationCSWText4 = R14.frmRegistrationCSWText4
      AND R13.frmRegistrationCSWText5 = R14.frmRegistrationCSWText5
      AND R13.fiscal = 2013
      AND R14.fiscal = 2014
      AND R13.Redetermination = 'Completed'
      AND R13.[CSW/TitleXX] = 'B')
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros