Transfer: https://blog.csdn.net/maco_wang/article/details/6261639
SQL SERVER is allowed to have a custom function, Microsoft SQL Server does not restrict users to define Transact-SQL is the language part of the built-in functions, but allows users to create their own user-defined functions.
Function is a subprogram or more Transact-SQL statements composition, the package code can be used for re-use. Although the custom function in a large amount of data when there is a lack of efficiency, but in small and medium sized databases, you can still use now in our database all the custom functions to share with you, and collected some posts that appear in CSDN custom functions to organize tests, such as fredrickhu (small F), dawugui (AiXinJiaoLuo. Yuk Wah), happyflystone (no gun sniper), dobear_0922 (do bear), htl258 (Tony), Haiwer (brighter), libin_ftsafe (sub street Red [I'm xiaoxiang]), cson_cson like C or friends to share some of the functions of the original.
To see the original: https://blog.csdn.net/maco_wang/article/details/6261639
01, marks and remove the contents html string in
02, the continuous removal string delimiter
03, seeking the first string number of the second string
04, comprehensive fuzzy query
05, will turn a decimal to hexadecimal
06, seeking the same characters and the number of letters in the two strings
07, to generate n-bit random string
08, taken in the kanji character string, alphabetic or numeric
09, the character string dividing three wording
10, the digitizer thousands separator form
11, take the first letter of the function of the two characters
12. The ID card to get a birthday function
13, the function is calculated according to gender identity
14, the ID number of 15 upgraded to 18
15, obtained by the household registration identity card
16, a plurality of strings of data items to take the specified character position
17, infix arithmetic calculations and arithmetic expressions transfected postfix function
18, the amount of RMB turn uppercase lowercase
19, left to fill the specified string
20, the integer number is converted to uppercase characters
21, checks the given sequence is present within the set point range and binding
22, returns the date constellation
23, the calculation of working days between two dates
24, generated according to a calendar date function
25, beginning from the first character string dividing
26, filter out duplicate character string
27, according to the date function to get the week
28, according to the annual determine whether it is a leap year
29, Lunar improve SQL conversion functions
30, SQL simplified conversion function
31, the custom function performs operations on bits
32, seeking a certain period of time the number of days of the week
33, according to the intake rounding or truncation evaluated
34, converted into a hexadecimal character string function
35, remove the front of the phone number with area code plurality of code fields
36, SQL2000 / 2005 string into a generic function list
37, find the number of kanji character string
38, the bar code to obtain parity function
39 years to get the number of days of the month in accordance with
40, the n is a positive integer power of decomposition of m 2 and
41, SQL displacement calculation function
42, a function of strokes of Chinese characters obtained
43, SQL digital transfer function English
44, full-width half-width conversion function
45, returns a random time within a time range of two
46, a function of acquiring the number of elements
47, acquires the specified function of the value of the index
48. The annual get all Sunday dates
49, generates all the time between the two dates
50, disorderly character comparison function
51, implements the RSA encryption and decryption functions (first edition) in the SQL SERVER
52, to achieve RSA encryption and decryption functions (second edition) in the SQL SERVER
53, the specified output format data column
54, the function Pinyin
55, digital-to-IP address of the function
56, encryption and decryption of string
57, calculation of personal income tax function
---------------------
Author: Leaves
Source: CSDN
Original: https: //blog.csdn.net/maco_wang/article/details/6261639
Disclaimer: This article as a blogger original article, reproduced, please attach Bowen link!