fullbugg
asked on
UPDATE query with Select from two databases
Hello,
I have to update a column in one database based on a select query that is between two databases checking for a null. This is what I have:
UPDATE db1.dbo.products
SET active = '0'
FROM (SELECT db1.dbo.products.sku
FROM db1.dbo.products
LEFT JOIN db2.dbo.item ON db1.dbo.products.sku = db2.dbo.item.itemlookupcod e
WHERE db2.dbo.item.itemlookupcod e IS NULL)
I am getting an invalid syntax error at ")"
I can't see what is wrong... please help.
I have to update a column in one database based on a select query that is between two databases checking for a null. This is what I have:
UPDATE db1.dbo.products
SET active = '0'
FROM (SELECT db1.dbo.products.sku
FROM db1.dbo.products
LEFT JOIN db2.dbo.item ON db1.dbo.products.sku = db2.dbo.item.itemlookupcod
WHERE db2.dbo.item.itemlookupcod
I am getting an invalid syntax error at ")"
I can't see what is wrong... please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER