sqlserver批量修改首字母为题写

发布时间:2019-05-03  栏目:sqlite  评论:0 Comments

‘hello
world’  —->   ‘Hello world’

update
tableName set columnName=CHAR(ASCII(SUBSTRING(columnName, 1,
1))-32)+SUBSTRING(columnName, 2, len(columnName))

WHERE (ASCII(SUBSTRING(columnName, 1, 1)) >96) AND
(ASCII(SUBSTRING(columnName, 1, 1)) < 123)

 

update
tableName set columnName= STUFF(
columnName,1,1,UPPER(SUBSTRING(columnName,1,1)))

留下评论

网站地图xml地图