At present in the reconstruction of the computer room charge system, this would like to summarize the errors encountered, but some errors, oneself is still in a state of chaos, so, then summed up something else.In refactoring we often deal with databases, especially data types, and here are some of the data types in SQL Server.One, Integer
.[National] VARCHAR (M) [BINARY]A variable-length string. Note: When the value is stored, the trailing spaces are deleted (this differs from the ANSI SQL specification). The range of M is 1 ~ 255 characters. The varchar value is based on the defaultCharacter sets are sorted and compared in a case-insensitive manner unless a binary keyword value is given. VARCHAR is an abbreviation for charactervarying.TinyblobTinytextA blob or text column with a maxim
Copy codeThe Code is as follows: --- replacement of ntext Data Type Characters
Create table tt(Sid int identity (1, 1 ),Cont ntext)Go
Insert into tt (cont) values (n'fd sad fdsa tujuwen tuyou Computer Information Technology Co. Ltd. may citrus ')GoUpdate tt set cont = 'fd sad fdsa tujuwen group possibility Association Friends Computer Information Technology Co. Ltd. orange 'where sid = 1
-- Remove spaceEXE
Label:Original: SQL Server geometry data typeExcerpt from SQL Server 2008 Help The flat spatial data type geometry is implemented as a common language-time (CLR) data type in
of Rowtype:1---AAARowtype:1 of Cursors---AAACursors: 1---AAATable of Rowtype:2---BBBRowtype:2 of the cursor---BBBCursors: 2---BBBTable of Rowtype:3---CCCRowtype:3 of Cursors---CCCCursors: 3---CCCIf you choose between explicit and implicit definition records, I tend to choose explicit definitions because it makes the logic clearer.2. Collection type--Index TableDeclareCursor Cur_test is a select id,name from test;
same format as the databaseBoolean Boolean TRUE OR FALSEROWID ROWID The line number that holds the database
Table 3 Date and Boolean
DataType
Range
Description
BOOLEAN
True/false
Store logical value TRUE or FALSE, no parameters
DATE
01/01/4712 BC
Store fixed-length date and time values, date values contain time
LOB data type
LOB (Lar
Tags: ima ext sele NULL definition Microsoft REM Arithmetic harThe data type setting for a field remark is set to Varcharr (255), which is later considered to be defined as the text type for extensibility, but the SQL statement is an error.SQL statements:SELECT * from TABLE WHERE ISNULL (Remark, ') Error message:
For relational databases, a hierarchical structure that behaves like a tree is always a problem. Microsoft first tried to solve this problem in SQL Server 2005, which is what is called a universal Datasheet expression (Common table expressions,cte) implementation.
Although the CTE works well in the existing database architecture, Microsoft has found a way to use such hierarchies as a first class concept. Therefore, in order to achieve this effect, th
Tags: net where Jackson template Max Port index Xtend RosQuery a table structure in SQL SERVER with the following SQL statement:SELECT tb.name AS tableName, col.name AS columnName, col.max_length AS length, col.is_nullable AS isNullable, t.name AS type, ( SELECT TOP 1 ind.is_primary_key FROM sys.index_columns ic LEFT J
1. Creating database: Create databases Such as: Create database student;2. Connect to an existing database: Use such as: Use student;3. Delete databases: Drop database such as: drop database student;4. Creating table: Create table Example: Create TABLE Stuinfo (stuid int primary key,stuname varchar () NOT NULL)5. Delete tables: drop table such as: drop table stuinfo;6, modify the table: ALTER TABLEAdd a new column to a table: ALTER TABLE Add multiple columns, separated by commasExample: Alter TA
Label:Original: SQL Server function Full solution 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
Create or replace procedure Pr_mytest isV_test number (8);--VariableV_char VARCHAR2 (10);C_CHANGL constant Number (12,3): = 3.14;--constantV_BM T_hq_ryxx.bumbm%type;Type Ty_ry is record--defines a record type(V_XINGM T_hq_ryxx.xingm%type,V_XINGB T_hq_ryxx.xingb%type,V_gongz
Tags: style blog http color using IO file dataError reason, when using the ADO entity, the database used by entity is SQL Server 2008, but then the database used in the actual use is SQL Server 2005The SQL Server version used does not support data type ' datetime2 'The versi
for log audit, but Microsoft has a tighter control over the API, and only the core partners who have signed a bunch of protocols can understand the API.
As a result, the current tracking of business data updates has always been a headache for the SQL Server platform, and users need to make a choice between putting in a lot of development effort and investing in additional procurement costs. Fortunately, M
Ing between SQL Serve and C # Data Types
Many of my friends use C # To develop database applications on the. NET platformProgramThe corresponding data type is not very clear and an error occurs. Therefore, I have compiled a corresponding table to list some common
Tags: style blog http color io using AR strong SPAnatomy of SQL Server third data type implementation (translation)http://improve.dk/implementing-data-types-in-orcamdf/The implementation of SQL Server data
DECLARE @i intSet @i= ' a 'Set @i=cast (' a ' as int)Set @i=convert (int, ' a ')Print @i--The output is: syntax error occurs when converting varchar value ' A ' to a column with a data type of int. This is not the same as Java
DECLARE @ch varchar (90)Set @ch =97Print @ch
--The display result is 97, which means that the implicit conversion to a string
DECLARE @ch varchar
column "Item number", "Amount", "Salesperson Number", and "time to sell".SELECT Product side number, amount, salesperson number, time of saleInto sales details 05_08From Sales informationWHERE sell time between ' 2005-8-1 ' and ' 2005-8-31 'The above statement is in the database "reseller", creating a new table named "Sales Details 05_08". The following SELECT statement allows you to view the newly marked data:SELECT * FROM Sales details 05_082.4.2 Saving results to a viewYou can also save quer
For relational databases, tree-like hierarchy is always a problem. Microsoft attempted to solve this problem for the first time in SQL Server 2005, that is, the implementation of common table expressions (CTE.
Although CTE works well in the existing database architecture, Microsoft has found a way to use such hierarchies as a top-level concept. Therefore, in order to achieve this effect, they proposed a "hierarchid"
Tags: note col ima img Type back technology share round characters1. String type Character string (based on ASCII encoding)Unicode string (Unicode-based encoding) Note: Using char to store Chinese characters (double-byte characters) can be garbled (and also look at the encoding format of the database), while using nchar, nvarchar guarantees that the display will always be normal.
char (1) ' A ' 1
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.