Tag Info

New answers tagged

2

Balu, the answer you posted will truncate the value to 30 characters because the no length was specified for the CAST and CONVERT declarations of the varchar and nvarchar data types. Consider using STUFF instead: --nvarchar example UPDATE dbo.YourTable SET UnicodeColumn = STUFF(UnicodeColumn, 1, 1, '') WHERE CAST(LEFT(UnicodeColumn, 1) AS binary(2)) ...


0

Finally, got it: select *, SUBSTRING(CAST(CAST(stringValue AS varchar) AS nvarchar), 2, LEN(stringValue)) from test_table where fileNumber=102 and CAST(left(stringValue,1) AS varchar)='?'; update test_table set stringValue=SUBSTRING(CAST(CAST(stringValue AS varchar) AS nvarchar), 2, LEN(stringValue)) where fileNumber=102 and CAST(left(stringValue,1) AS ...


1

I assume you will do this for each table? ALTER TABLE tbl CONVERT TO CHARACTER SET utf8mb4; One potential issue involves the maximum of 767 bytes per column in an INDEX. If you currently have a VARHAR(255) latin1 field in an index, you will need to rethink it. Decrease it to VARCHAR(191) if you are sure that 191 will suffice (into the future) Use a ...



Top 50 recent answers are included