数据库表内容复制会自动带换行:
招聘信息
应届毕业生
不带换行:
招聘信息应届毕业生
1> 回车符 char(13)
SELECT *, REPLACE(detail, CHAR(13) , '<br>') AS 显示替换后的内容 FROM Test
2>换行符
SELECT *, REPLACE(detail, CHAR(10), '<br>') AS 显示替换后的内容 FROM Test
3>回车换行符
SELECT *, REPLACE(detail, CHAR(13) + CHAR(10), '<br>') AS 显示替换后的内容 FROM Test
4>将回车换行符替换成<BR><BR>
UPDATE TestSET detail = REPLACE(detail, CHAR(13) + CHAR(10), '<br><br>')
update t_news set content=REPLACE(content, CHAR(13) + CHAR(10), '<br><br>') where news_type=3
在内容前面加两个空格,全角的update t_news set content=' '+content where news_type=3
例:
SELECT *, REPLACE(name, CHAR(10), '') AS 显示替换后的内容 FROM [dbo].[Tb_Menu_List]
UPDATE [dbo].[Tb_Menu_List]
SET name = REPLACE(name, CHAR(13) + CHAR(10), '')