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.
Author |
Topic |
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-09-06 : 10:48:39
|
I'm trying to update the column (ckid) to increment by 1 with the following statement below, but it is not working. It update the field with the same value...can someone point out where I did wrong? Thank-you....update T set T.ckid=X.ckIDfrom tbl1 T inner join (select (MAX(isnull(ckID,100))+1) as ckID,numid,comp,ln1,nl2 from tbl1 group by umid,comp,ln1,nl2)Xon T.numID=X.numIDand T.comp=X.compand T.ln1=X.ln1and T.Ln2=X.Ln2 |
|
Kristen
Test
22859 Posts |
Posted - 2007-09-06 : 11:03:25
|
I presumegroup by numid,comp,ln1,nl2is a typo?therefore is this the actual code you are using? (I figured you would have cut&pasted it, but obviously you didn't ...)Kristen |
 |
|
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-09-06 : 11:08:40
|
Hi Kristen, Yes...it is a typo on my part.thanks |
 |
|
|
|
|