June 8, 2017 at 3:37 am
Hello,
I've a problem with a REPLACE command that gives no error but is not effective and makes UPDATE command fail.
It works perfectly for the first column "..n-1..." and not for the 2nd column "..n-2...".
The table has 1M rows.
What could be the problem ?
Do I need to COMMIT TRANSACTION after each UPDATE statement ?
By advance, thanks for your help.
Regards,
Steve.
June 8, 2017 at 3:59 am
You're not running in a transaction, so no, you don't need a COMMIT (and you wouldn't even if this was in a transaction)
It's possible that the whitespace character is something other than CHAR(160), Have you looked at exactly what it is?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2017 at 4:03 am
The 2nd screenshot seems to prove it's actually a char(160) in the data, doesn't it ?
June 8, 2017 at 4:21 am
Ah, I just noticed what you're doing.
You're never updating that long column name, you update NbCum, then try to alter the long column name, and it still has the char(160) in, because it wasn't the target of the update.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2017 at 5:45 am
Whaooo!
I feel so stupid. :o(
I should sleep more or change my glasses.
It's now obvious ! :o)
One colleague had a look and did not see anything too...
Thanks !
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply