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....

Author  Topic 

petek
Posting Yak Master

192 Posts

Posted - 2008-11-03 : 05:03:13
Hi All

Firstly thanks for looking......

I need to run an update statement on a table that uses data
from a column in a table an updates the destination column (in the same table)
with that data.....

Basically i am running the following code and it returns :
Subquery returned more than 1 value.

update dbo.HoldingtableNOMatch set initials =
(Select SUBSTRING(Forenames,1,1)
FROM HoldingtableNOMatch)


What I am trying to do is select the first letter from the forename column
and update the initials column with the result, i have 200 rows in the table

Please help....


Kind Regards

Pete.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-03 : 05:37:27
is it this?

update dbo.HoldingtableNOMatch set initials = SUBSTRING(Forenames,1,1)
Go to Top of Page

petek
Posting Yak Master

192 Posts

Posted - 2008-11-03 : 06:40:24
visakh16 that was great, thanks for your help again.

Kind Regards

Pete.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-03 : 06:47:37
Cheers
Go to Top of Page
   

- Advertisement -