Jump to content

Update table form select


NewEra13

Recommended Posts

Hello again,

 

By the way could you help me make this update work as for i'm getting the error message:

Incorrect syntax near ')'

 

 

UPDATE dbo.Part

 

SET SupplierShortName = NationalSupplier.ShortName,

 

SupplierLongName = NationalSupplier.LongName

 

from(SELECT *

 

FROM dbo.Part

 

JOIN dbo.NationalSupplier

 

ON Part.SupplierNumber = NationalSupplier.Number

 

AND (ISNULL(Part.SupplierShortName,'') <> ISNULL(NationalSupplier.ShortName,'')

 

OR ISNULL(Part.SupplierLongName,'') <> ISNULL(NationalSupplier.LongName,''))

 

LEFT OUTER JOIN dbo.NationalPart

 

ON Part.NationalPartID = NationalPart.NationalPartID

 

WHERE Part.DWCreationEntityID = 1

 

AND NationalPart.NationalPartID is NULL)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...