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)
 update query failing

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-09-29 : 08:38:38
update emrcotransactions et set role_name = (select distinct role_name from EMRUSERROLELOCATION b where
b.user_login = et.user_login) where task_id = 65
GO

throwing exception as

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'et'.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-29 : 08:43:28
update et
set role_name = (select distinct role_name from EMRUSERROLELOCATION b where b.user_login = et.user_login)
from emrcotransactions et
where task_id = 65



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-29 : 08:46:18
how many rows does
select distinct role_name from EMRUSERROLELOCATION b where
b.user_login = et.user_login

return? you want multiple values to be stored on same col?
Go to Top of Page
   

- Advertisement -