🌻
SQLServer でText型の扱い
text型項目の実際の長さを知る
SELECT LEN(CAST( item AS varchar(8000))) FROM table
text型をintにコンバートする
UPDATE table
SET
[intcd] = convert(int, CONVERT(VARCHAR(MAX), [textcd])
SELECT LEN(CAST( item AS varchar(8000))) FROM table
UPDATE table
SET
[intcd] = convert(int, CONVERT(VARCHAR(MAX), [textcd])
Discussion