SQL Server????????????
????????????? ???????[ 2016/8/15 11:01:03 ] ????????????? SQL Server
???????
?????????????????????????????????????????些???????????? ?????????????????????????????????????????????????????????????????????????械??路??????????????
???????????? golds??? ?????5??????????????44 ?????卸??????????????????小?
?????????????
?????????????煤???
????1??????????ASCII?? ASCII
????ASCII?????????????????????????ASCII????????????ASCII??????????
??????????
????ASCII(espression)
?????????expression?????????char??varchar??????????????ASCII??????????????????????ASCII?????–????????
???????????int?????????
?????????
????select ASCII(‘f’) –??? 102
??????????????????????????????????????????ASCII?????
????2?????ASCII????????? Char
??????????
????char(integer_expression)
??????????????char?????
?????????
????select char(102) — ???f
????3??????????unicode???? Unicode
????unicode???????????????unicode????
??????????
????unicode(‘ncharacter_expression’)
?????????ncharacter_expression??nchar??nvarchar?????????????????????????????unicode????
???????????int????????
?????????
????SELECT Unicode(‘??’) — ??? 39134
????4?????unicode???????????nchar
????nchar???????unicode???????澹�?????????????????????unicode?????
??????????
????nchar(integer_expression)
???????????unicode???
?????????
????SELECT nchar(39134) — ??? ??
????5??????????????LEN
????len????????????????????(?????)?????????????????????????????????????
??????????
????len( string_expression )
?????????????
????string_expression?????????????????
???????????expression?????????varchar(max)??nvarchar(max)??varbinary(max)?????bigint???????int??
?????????
????select len(‘??????????娌�??’) — ??? 9
????6??REPLACE
??????????????????婊�????????????????????
?????????锟�?
????REPLACE ( string_expression1 ?? string_expression2 ?? string_expression3 )
????????
????string_expression1:??????????????????string_expression1 ?????????????????????????
????string_expression2:???????????????string_expression2 ?????????????????????????
????string_expression3:?婊�???????string_expression3 ?????????????????????????
????SELECT REPLACE(‘abcde’??’abc’??’xxx’) –xxxde
????7 ?????位????????????械?????CHARINDEX
????charindex????????????????????????????????????????????????????????位???????????????????????????????
??????????
????charindex ( expression1 ?? expression2 [ ?? start_location] )
?????????????
????expression1???????????????????????????邪?????????????????小?
????expression2???????????????????????????????????????????????小?
????start_location???????expression2??????expression1??????位?谩????start_location未????????????????????????expression2?????????????????????????start_location??????bingint?????
??????????????expression2???????????varchar(max)??nvarchar(max)??varbinary(max)?????bigint???????int??
?????????
????select charindex(‘456′??’123456789’) — ??? 4 ??123456789?屑???456?????位??
????select charindex(‘456′??’123456789’??4) — ??? 4
??????????
?????????????????????????????????????????慰?????????????????????????????????
??????????????????????????????????????
?????????????????????????????????????????????0????????????????????”??
?????????????ascii?????
??????ascii???ASCII ?????????????ASCII ????????? 0–31 ???????????????????????????????些??围?璞�??
???????????1????????????????????????????????char(0)???????char(0)??????????????薪???
??????????????????榈�????????????????replace?????婊�????????????锟�????娼�?????????????
????????榈�????char??0????????????????????golds????????????????39??char??0?????????????????????????????
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11