troubleshooting Question

SQL Update

Avatar of ITBenelux
ITBeneluxFlag for Belgium asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
6 Comments1 Solution182 ViewsLast Modified:
Experts,

I don't understand why my update statement is not working

I want to update table tbluser with values of tblDump, comparing the UserID's.  I put a unique index on the userID field in both tables, So I'm 100% sure there are no duplicate values.  yet.. when running the update statement. I get back 'Subquery returned more than 1 value.' ?? which should be impossible. because there is always one value for one ID ?

thx for helping me out on this one.
USE users
UPDATE tbluser
SET PartnerBirthday = (SELECT PBirthday
FROM users.dbo.tblDump
WHERE users.dbo.tblDump.userid  = users.dbo.tbluser.userid)
ASKER CERTIFIED SOLUTION
BourbonKid

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros