One: Data type conversion functionWhen you work with values of different data types at the same time, SQL Server typically automatically makes a hermit type conversion. Values that are similar to data types are valid, such as int
Tags: length understanding cannot int use style substring English productObjectivePrevious articles we explained the index of knowledge, this section we continue to explain the following, short content, in-depth understanding.Data typeSQL Server supports two character data types, one is general and the other is Unicode. General data types include char and varchar,unicode
The data type of SQL determines how the contents of a field are processed, stored, and displayed in the database. SQL92 defines a standard data type to provide a blueprint for database manufacturers to establish their own data typ
_t WHERE c = N '; --Actual 9,900 strips Goset showplan_all OFF; GO
The estimated number of rows for the resulting query plan is as shown
The estimated number of rows displayed shows that the estimated results are accurate for varchar values (no hidden data type conversions are required). However, for the nvarchar value, regardless of whether the specified value is only one
Tags: store from type Jin into CAS statement end SQL statementBitInteger data 1, 0, or NULL (the representation in the table).Comments:You cannot use an index on a column of type bit.Microsoft? SQL Server? Optimizes storage for bit columns. If there are no more than 8 bit co
SQL Server (c) grouping type conversion functions insert multiple data String functionsMy own study notes, reproduced please indicate the source, thank you!---sauerkraut1.SQL Data grouping----Group by/having① has a student information sheet: STUID/STUNAME/STUAGE/STUGENDER/ST
Tags: style color os using AR data sp on COracle's PL/SQL Learning Notes data type (iii)Variables are most frequently used in all programming languages. As a process-oriented database programming language, PL/SQL also requires variables, which can be used to pass the paramet
length
Date and time
Date and time are entered separately in single quotation marks
Datetime
Date and time
Bit data type
Data that represents yes/no, there are only two options. In SQL Server 1 and 0 represent, General 1 means yes, 0 indicates no.
Bit
Storing B
Suppose there are stored procedures: proc_test2Create proc Proc_test2@Id intBeginAsDECLARE @sql varchar (max)@sql = ' SELECT * from test2 where 1=1 'If @Id Set @sql + = ' and Id = ' +@IdEXEC (@sql)EndThe parameters required by the stored procedure are of type int, and the di
Composite type
A composite type can store multiple values, including records and collections. A set is one-dimensional, but it can be set into a multidimensional collection by putting other collections in it. The collection is divided into three kinds of index table, nested table and variable length array. To use a collection, we first create a collection type a
, 2079, with a precision of 1 minutes.SmallInt
Supported by the. NET Compact Framework.Int16
A 16-bit signed integer.SmallMoney
Supported by the. NET Compact Framework.Decimal
A currency value ranging from -214,748.3648 to +214,748.3647, with a precision of 10 per thousand monetary units.Text
Supported by the. NET Compact Framework.String
Variable-length stream of non-Unicode data with a maximum length of 231-1 (or 2,147,483,647) characters.Timestamp
String
21st
Binary data
Binary
Byte[]
22
varbinary
Byte[]
23
Image
Byte[]
24
Other
uniqueidentifier
Guid
25
Variant
Object
PS. Originally intended to reprint trackback:http://tb.blog.csdn.net/trackback.aspx?postid=95675 (SQL Server corresponds to the
expression1 or expression2 belongs to the Unicode data type (nvarchar or nchar) and the other does not, the other is converted to a Unicode data type. If one of the expression1 or expression2 is a null value, CHARINDEX returns a null value when the database compatibility level is 70 or greater. When the database compa
Text type:Char: fixed -length non- Unicode character data with a maximum length of 8,000 charactersVARCHAR: variable -length non- Unicode character data with a maximum length of 8,000 charactersText: Store long text messages with a maximum length of 231-1 (2147483647) charactersNCHAR: fixed-length Unicode character data with a maximum length of 4,000 charactersNV
Tags: blog http using file data IO problem htmlThis article originates from: http://www.cnblogs.com/zhhh/archive/2011/04/06/2006868.htmlA circular reference is detected when a data object is serialized using LINQ to SQL and a System.InvalidOperationException exception is reported, and an object of the type is serialize
1. Prepare the data files that need to be transferred and transfer them to the server2. Create a new target table in the databaseDROP TABLE lob_tab;CREATE TABLE lob_tab ( number_content NUMBER(10), varchar2_content VARCHAR2(100), date_content DATE, clob_content CLOB, blob_content BLOB);3. Write the control file for SQL loader (named: LOB_TEST.CTL)LOADDATA INFILE' Lob_test_data.txt '
if the amount of data is small, create a table and insert it in order to mitigate the resources of the system tables.
If a temporary table is used, TRUNCATE TABLE first and then drop table when all temporary tables are finally explicitly deleted, which avoids longer locking of the system tables.
Index
You should first consider establishing an index on the columns involved in where and order by.
When using an indexed field as a
1.Bit type: bit (1) don't think it's just a bit, in fact it's going to take up a byte! That means when n 2.varchar (n) here n cannot be greater than 8000, if you want to be larger than 8000 you can only specify varchar (max); Here's the same for nvarchar (n).What I don't understand is why 8000 is not 2 of the 16-time party! Why Max can be infinitely big!3.Sql_variant can think of it as an object type in C#/
Date Time Data type* System constants:@ @DATEFIRST (back to current time)DATEADDAdd TimeSyntax: DATEADD (datepart, number, date)Select DATEADD (year,2, ' 2013-11-2 ')DATEDIFFDistance between two datesSelect DATEDIFF (year, ' 2011-7-18 ', ' 2014-11-2 ')DatenameReturns a time value in which you want to get the number of a block typeSelect Datename (year, ' 2011-7-8 ')DATEPARTSelect DATEPART (Second, ' 2014-11
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.