Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the basic functions of Sql Server

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the introduction of the basic functions of Sql Server". In the daily operation, I believe that many people have doubts about the introduction of the basic functions of Sql Server. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "introduction to the basic functions of Sql Server"! Next, please follow the editor to study!

1. String function length and analysis use datalength (Char_expr) to return the string contains characters, but does not contain the following spaces substring (expression,start,length) not to say, take the substring right (char_expr,int_expr) to return the right side of the string int_expr character operation class upper (char_expr) to uppercase lower (char_expr) to lowercase space (int_expr) to generate int_expr spaces replicate (char_expr) Int_expr) copy string int_expr times reverse (char_expr) reverse string stuff (char_expr1,start,length,char_expr2) replace length characters starting from start in string char_expr1 with char_expr2 instead of ltrim (char_expr) rtrim (char_expr) remove spaces ascii (char) char (ascii) two functions correspond, take ascii code, and look for charindex (char_expr) according to ascii character string Expression) returns the starting position of the char_expr patindex ("% pattern%", expression) returns the starting position of the specified pattern, otherwise 0 2. 0. The mathematical function abs (numeric_expr) calculates the absolute value ceiling (numeric_expr) takes the smallest integer exp (float_expr) greater than or equal to the specified value and takes the index floor (numeric_expr) less than or equal to the specified maximum integer pi () 3.1415926. Power (numeric_expr,power) returns power power rand ([int_expr]) random number generator round (numeric_expr,int_expr) Ann int_expr specifies precision rounding sign (int_expr) based on positive, 0, negative, returns + 1 sqrt (float_expr) square root 3. The date function getdate () returns the date datename (datepart,date_expr) returns the name such as June datepart (datepart,date_expr) take part of the date datediff (datepart,date_expr1.dateexpr2) date difference dateadd (datepart,number) Date_expr) return date plus number the writing value and meaning of datepart in the above function yy1753-9999 qq1-4 engraved mm1-December dy1-366 dd1-31 wk1-54 weeks dw1-7 weeks hh0-23 hours mi0-59 minutes ss0-59 seconds ms0-999ms date conversion convert () 4. System function suser_name () user login name user_name () user name in database user user name show_role () rules db_name () database name object_name (obj_id) database object name col_name (obj_id,col_id) column name col_length (objname,colname) column length valid_name (char_expr) is a valid identifier here The study of "introduction to the basic functions of Sql Server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 222

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report