Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update

Author  Topic 

a.ashabi
Posting Yak Master

117 Posts

Posted - 2008-09-18 : 14:30:01
but now I have another problem!
when I want to update the table:

UPDATE name$
SET product_id =(SELECT dbo.tbl_product_vendor.product_id AS PID FROM dbo.tbl_product_vendor CROSS JOIN
dbo.name$
WHERE (dbo.tbl_product_vendor.vendor_code LIKE '%' + dbo.name$.product_vendor_code + '%'))

the error is subquery returned more than one value.
what should I do to update all the fields on name$ table?
thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 14:33:54
[code]UPDATE name$
SET product_id =dbo.tbl_product_vendor.product_id
FROM name$
INNER JOIN dbo.tbl_product_vendor
ON dbo.tbl_product_vendor.vendor_code LIKE '%' + dbo.name$.product_vendor_code + '%'
[/code]
Go to Top of Page

a.ashabi
Posting Yak Master

117 Posts

Posted - 2008-09-18 : 14:40:45
thanks.It worked :)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 14:41:24
quote:
Originally posted by a.ashabi

thanks.It worked :)


welcome
Go to Top of Page
   

- Advertisement -