SyntaxUse CAST:
CAST (expression AS data_type)
Use CONVERT:
CONVERT (data_type [(length)], expression [, style])
ParametersExpression
Is any valid Microsoft SQL Server "expression. For more information, see expressions.
Data_type
The data types
GrammarUse CAST:
CAST (expression as data_type)
Use CONVERT:
CONVERT (data_type[(length)], expression [, style])
ParametersExpression
Is any valid Microsoft SQL Server expression. For more information, see expressions.
Data_type
The data
I have read a lot of help to understand the quotename function, as shown in the following example.Quotename (TRANSACT-SQL)
Returns a unicode string with delimiters. Adding delimiters can make the input string a valid Microsoft SQL Server 2005
First, the identifiers in sqlserver have certain rules. For example, if your createtableabc123 (...) contains spaces, it does not comply with the rules. You will write createtable [abc123] (...) to define the identifier using. Quotename makes the
Explicitly converts a data type expression to another data type. CAST and CONVERT provide similar functions.
Explicitly converts a data type expression to another data type. CAST and CONVERT provide similar functions.
SyntaxUse CAST:
CAST
The SQL injection vulnerability attacks have aroused widespread concern because they can penetrate the firewall and Intrusion Detection System to damage your data layer. Whether it is the first or second-level injection attack, if you look at the
For example: We import a customer's information, we know that the customer's name is Zhangshan, we want to know, in our business database (Eg:northwind), which of the data tables which fields set the name value Zhangshan, through the following SQL,
Recently, due to the ERP project, we need to know which tables and columns of the background database are written in the Application Operation of the Foreground Data Import function.
Recently, due to the ERP project, we need to know which tables and
PS: From the BLOG of heige, we can see that the problem lies in QUOTENAME () and REPLACE (). I jumped to Microsoft and found it.
Injection enabled by data TruncationIf any dynamic Transact-SQL statement assigned to a variable is larger than the
MSSQL provides us with two commands for dynamically executing SQL statements, namely exec and sp_executesql, and generally, sp_executesql has the advantage of providing an input-output interface, and exec does not. One of the biggest benefits is the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.