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 2008 Forums
 Transact-SQL (2008)
 bulk update

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2013-11-12 : 06:18:10
Hi,
below query i try to execute,

update DeathData set fid = (select fid from tblfuneral where funeralsite in(select funeralsite from DeathData )


but it throws the error, please give the solutions

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.





Desikankannan

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2013-11-12 : 06:35:35
In this case we need table structure, sample data AND wanted result in relation to the sample data...


Too old to Rock'n'Roll too young to die.
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-12 : 06:41:50
MAy be this?
update d
set d.fid = tf.fid
from DeathData d
JOIN tblfuneral tf
ON tf.funeralsite d.funeralsite


--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-12 : 12:55:54
quote:
Originally posted by bandi

MAy be this?
update d
set d.fid = tf.fid
from DeathData d
JOIN tblfuneral tf
ON tf.funeralsite = d.funeralsite


--
Chandu



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -