Exception handling Rollup-database family http://www.cnblogs.com/dunitian/p/4522990.html
Let's see what happens.
Copy the query to the data, paste it to see what the situation
then batch processing ~
That's it? NoNoNo, stretch a bit ~ our various lazy (the world is lazy people change)
Simple Package First
--Preliminary package
DECLARE @cloumnName varchar = ' tname '
Update Shopmenutype set @cloumnName =replace (@cloumnName, char (Ten), ")---remove line break
Update Shopmenutype set @cloumnName =replace (@cloumnName, char (+), ')---remove carriage return
Update Shopmenutype set @cloumnName =replace (@cloumnName, ', ')---remove whitespace
Try to be able to encapsulate in depth
Final package (can also be simplified, if there is a better way to welcome the post, the inverse day grateful)
DECLARE @tableName varchar, @cloumnName varchar, @sqlStr nvarchar (1000)
Select @tableName = ' Shopmenutype ', @cloumnName = ' tname '--each time you replace the table name and column name here.
Set @sqlStr = ' Update ' [email protected]+ ' Set ' [email protected]+ ' =replace (' [Email protected]+ ', char (), ' ') '--- Remove line breaks
Set @[email protected]+ ' Update ' [email protected]+ ' Set ' [email protected]+ ' =replace (' [Email protected]+ ', char (13), ' ' ') '---remove carriage return
Set @[email protected]+ ' Update ' [email protected]+ ' Set ' [email protected]+ ' =replace (' [Email protected]+ ', ' ' ', ' ') '- --Remove whitespace
Print @sqlStr
EXEC (@sqlStr)
SQL: Specifies that the name does not find the data's extension ~ Space line break character return batch processing