我想在sql腳本中替換一個字符串。即時通訊使用此查詢如何刪除包含字符串的行?
update [master].[dbo].[Test]
set Student_ID = REPLACE (Student_ID , '1|2_', '1|2_345_')
我覺得我的查詢是正確的,但即時得到這個錯誤「字符串或二進制數據將被truncated.The語句已終止」 我想這是因爲發生在列student_id數據有冗餘數據如「hdhvjf124rgrthrt」。如何刪除包含「hdhvjf124rgrthrt」東西的行?
alireza_s_84是正確的,檢查列數據長度 –
我將它從nvarchar(255)更改爲nvarchar(max),它工作。非常感謝你 – meow