Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
hello all,i have a table in which i have 2 columns code and descriptionin first column i have data like 1 - Prevention2 - Respiratory3 - Cardiovascularin 2nd column NULLNULLNULLi need to update only Prevention,Respiratory,Cardiovascularinto 2 nd column i have written query like this :update ECT_HEDIS_SubDomain set SubDomainDescription = b.SubDomainDescriptionfrom ECT_HEDIS_SubDomain bINNER JOIN ECT_HEDIS_SubDomain aon substring(a.ECTSubDomainCode,1,4) = b.ECTSubDomainCodesuggest meP.V.P.MOhan
djj55
Constraint Violating Yak Guru
352 Posts
Posted - 2012-12-27 : 11:33:51
Please check your example code as it looks like you are joining the table to itself. Also this will only update where ECTSubDomainCode is four characters or less.