SQLSERVER大小写转换方法如下:
- CREATE FUNCTION dbo.Test_2 (@S VARCHAR(100))
- RETURNS VARCHAR(100)
- AS
- BEGIN
- DECLARE @re NVARCHAR(20)
- IF ascii(@S) BETWEEN ascii('A') AND ascii('Z')
- BEGIN
- SET @re = LOWER(@S);
- END
- ELSE
- BEGIN
- SET @re = UPPER(@S);
- END
- RETURN @re
- END;
- GO
复制代码 调用方法:
结果如下:
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |