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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 updating table column from another table

Author  Topic 

lior3790
Starting Member

46 Posts

Posted - 2007-04-25 : 02:00:07

Peace,

I have one table in a catalog and i need to update another table from a different catalog.

i get error messeage when trying to to do this query:
use[IMS]

use[IMS-Frontend]


UPDATE [IMS-Frontend].[dbo].[NameNation]

SET BigFlag=(select t.BigFlag from [ims].[dbo].[playerbasicinfotable] t inner join [IMS-Frontend].[dbo].[NameNation] n on t.nationality=n.nationname group by t.BigFlag )



quote:
Msg 512, Level 16, State 1, Line 6

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

The statement has been terminated.




anyone has an idia how to do so?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-25 : 02:03:24
[code]
UPDATE n
SET BigFlag = t.BigFlag
FROM [IMS-Frontend].[dbo].[NameNation] n
from [ims].[dbo].[playerbasicinfotable] t inner join [IMS-Frontend].[dbo].[NameNation] n
on t.nationality = n.nationname
[/code]


KH

Go to Top of Page

lior3790
Starting Member

46 Posts

Posted - 2007-04-25 : 02:09:17
UPDATE n
SET BigFlag = t.BigFlag

from [ims].[dbo].[playerbasicinfotable] t inner join [IMS-Frontend].[dbo].[NameNation] n
on t.nationality = n.nationname


thanks a lot KH
Go to Top of Page
   

- Advertisement -