From: http://blog.csdn.net/lele5000/article/details/6704247
Preface:
The implementation of MD5 and base64 functions is not the focus of this article. The focus is on the trouble of Character Set conversion during implementation.
Recently, due to
How to explain N in varchar (N) and nvarchar (n: Nvarchar (n) can store up to nCharacter, Does not distinguish between Chinese and English. Varchar (n) can store up to n Bytes, A Chinese character is two bytes.
Space occupied:A single nvarchar (n)
/* Cursor */ -- A cursor is actually a mechanism that can extract a record from a result set that contains multiple data records. /* The Role Of The cursor */-- Allows specific rows in the result set to be located.-- Retrieve one or more rows of
IF OBJECT_ID ('dept ')IS NOTNULL
Drop table Dept
Go
Create table Dept (IdINT, ParentId INT, DeptName NVARCHAR (10 ))
INSERT Dept SELECT 1, 0, N 'food'
UNION ALLSELECT 2, 1, N 'fruit'
UNION ALLSELECT 3, 1, N 'veggie'
UNION ALLSELECT 4, 2, N
Several data types that store strings: char (10) nchar (10) varchar (10) nvarchar (10) varchar (max) nvarchar (max) -- text and ntext are not recommended, we recommend that you use varchar (max) and nvarchar (max) textntext =========== differences
DECLARE @ docHandle int;DECLARE @ xmlDocument nvarchar (max); -- or xml type
SET @ xmlDocument = n' CompanyName = "Company2"> No Orders yet! ';
EXEC sp_xml_preparedocument @ docHandle OUTPUT, @ xmlDocument;-- Use OPENXML to provide rowset consisting
People often encounter coalesce functions, and most of them regard them as a more effective form of isnull. In fact, I found that it is a very useful function, but there are only a few documents. In this article, I will show you the basic usage of
SQL generates n-bit random strings and SQL generates n
-- 1. Use newid () go -- to create a view (because newid () cannot be directly used in the function) create view vnewid as select newid () N 'macoid '; go -- create function getrandstr (@ n int)
Based on the summary of the two blog posts
Summary of commonly used data paging technology: http://www.cnblogs.com/refactor/archive/2012/06/28/2552700.html
Summary http://www.cnblogs.com/kingboy2008/archive/2011/06/22/2086710.html of several data
From: http://blog.163.com/liufupanhao@126/blog/static/128465170201111210446407/
Thank you for sharing your ideas!
1. Data type conversion: (1) Two conversion scenarios:A: When the data between two result sets is compared or joined together, if the
I have written an article about how to replace an expired image certificate: SQL Server image certificate expiration. This is a test preparation for replacing a certificate. In this article, I encountered some problems when I replaced a large number
Copy codeThe Code is as follows: using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Text. RegularExpressions;
Using System. IO;
Using
MSSQL Random Number
MSSQL has a function CHAR () that converts int (0-255) ASCII code into characters. Then we can use the following ms SQL statement to randomly generate lower-case, upper-case letters, special characters and numbers.
Uppercase
LEN (string_expression) parameter: string to be calculatedReturnsCharacter Count, Which does not contain trailing spaces.If the expression data type is varchar (max), nvarchar (max), or varbinary (max), it is bigint; otherwise, it is int.Ntext
1.1.1 Summary
If we want to optimize the database, we can optimize the database system using the following five methods.
1. Computer hardware optimization2. Application Optimization3. Database INDEX OPTIMIZATION4. SQL statement Optimization5.
Now we will introduce how SQL Server 2008 R2 stores data.
The basic unit of data storage in SQL Server is page. Disk space allocated for data files. mdf or. ndf in the database can be logically divided into pages with numbers ranging from 0 to n ).
The LOB page in SQLSERVER is a simple study. This article is complementary to my other article, before reading the article "Simple Research and Test of SQLSERVER2012 column storage Index", I hope you can read this article o (_) first (_) I believe
In a team project, there is no agreement on Collation, programming in the ms SQL Server will encounter such a problem:Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL _Latin1_General_CP1_CI_AS" in the equal to operation.
As a small programmer, it is inevitable to deal with wherein and like in daily development, in most cases, the parameters we pass are not much simple, single quotation marks, sensitive characters escape, and then directly spelled into the SQL,
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.