sqlserver批量修改首字母为大写

2016-12-14 19:03:59来源:cnblogs.com作者:Steven.Ji人点击

'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)))

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台