Tags: rom sina bcd alt nvarchar like database HTML primSOURCE http://blog.sina.com.cn/s/blog_457d6e63010108tv.html Not tested. SQL SERVER 2000/2005 is not case-sensitive by default, and can be collate chinese_prc_cs_as to require case
Tags: Using data database SQL Har arThe following statement is to set whether the SQL Server database is case-sensitive: (Table name and database field name)--Modify database is case insensitiveALTER DATABASE name
For accidental reasons, when the inner join table is required, the corresponding field must beCase Sensitive. By default, SQL Server databases are case-insensitive. How can this problem be solved?
To achieve this, there must be at least three operation levels:
1.Database level: The entire databaseChar,Varchar,Text,Ncha
By default, SQL Server queries are case-insensitive. That is, whereaABC is the same as wherea 'abc '.
By default, SQL Server queries are case insensitive. That is, where a = 'abc' is the same as where a = 'abc '.
However, we
Label:Example:SELECT * from tb_students where name= ' Jay 'SELECT * from tb_students where name= ' JAY 'The results of these two sentences are the same.Case sensitivity requires adding collate chinese_prc_cs_as:SELECT * from tb_students where name collate chinese_prc_cs_as= ' Jay 'SELECT * from tb_students where name collate chinese_prc_cs_as= ' JAY 'CI:
Tags: length sele nba def where ble differentiate sel tabSQL Server defaults to case-insensitive queries, but sometimes some query statements require a case-sensitive query, which requires some special handling. There are two main ways of distinguishing between case and case
Table
Alter table name
Alter column name nvarchar (100) (type) Collate chinese_prc_ci_as
-- Case insensitive
ALTER TABLE TBAlter column colname nvarchar (100) Collate chinese_prc_cs_as-- Case sensitive
Modify to fieldAlso, in the design table-field-sorting rules -... S
By default, SQL Server is case insensitive to field values. For example, if the data value is "admin", but where username = 'admin' can also be queried, it is even worse if it is a password, haha.
If
Program Internal verification is performed in the SQL stored procedure.
--
-- Set
Used for saving and comparing characters. "Run the following statement in the query analyzer to obtain all the sorting rules supported by SQL Server.
Select * From: fn_helpcollations ()
The name of a sorting rule consists of two parts. The first half is the character set supported by this sorting rule.For example:Chinese_prc_cs_ai_wsFirst half: the Unicode character set. The chinese_prc _ pointer sorts
Original: About SQL Server character type query condition case-sensitiveThe SQL query is written as follows:SELECT * from Users where username= ' Wange 'SELECT * from Users where username= ' Wange 'The results of the above two query statements are the same, indicating that the username condition is not
saving and comparing characters. "Run the following statement in the query analyzer to obtain all the sorting rules supported by SQL Server.
Select * From: fn_helpcollations ()
The name of a sorting rule consists of two parts. The first half is the character set supported by this sorting rule.For example:Chinese_prc_cs_ai_wsFirst half: the Unicode character set. The chinese_prc _ pointer sorts Unicode in s
Problem
SQL Server provides you with the ability to store mixed-case data in your database, but depending on how you create the database, SQL Server ignores the case when you give T-SQL
1. To determine that no one else is connected to the current database. You can view it with sp_who, and then use the kill @spid force it to close its connection.
2. Execute SQL, modify DB's Collate property
Use [master]
Go
ALTER DATABASE [my_db] COLLATE finnish_swedish_cs_as
Go
3. Get the original used collate
U
Khan, today by the SQL Server COLLATE clause big play a, watch online help not careful! Let yourself around a large circle, later look at Ms Help to be careful, the thing is this:
Afternoon, the eldest brother sent us a section of SQL Script, we want to test, see if there is no error, if so, please propose! The whole
Tags: style blog color using IO problem div lineYou encounter collate conflicts when using SQL to query a table, such as:Select from [dbo]. VmimageunionSelect from [dbo]. [Dicvmimage]Get the error:468 - 9 1 "chinese_prc_ci_as" "sql_latin1_general_cp1_ci_as" in the UNION operation.The initial suspicion may be due to the collate conflict of the two table in th
1. To confirm that no other person is connected to the current database, use sp_who to view the connection, and then use kill @ spid to forcibly close the connection.
2. Run the SQL statement to modify the database's collate attribute.
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Use
[
Master
]
Go
Alter
Database
[
My_
Search the internet about the data types of comparison, there are almost no three database comparison, I wrote some of the comparison of the fields, if there is a wrong place, please feel free.
Java fields
Oracle Fields
MySQL Field
SQL Server Fields
Int
Number
Int
Int
Java.lang.double
Number (P,s)
Double
Float
SQL case-sensitive-reprint
①
You do not have to install it to differentiateCase sensitivity, Directly convert the value to be comparedBinaryAffect performance. ② add rules, not supported by sql7Compare the following two items:Print cast ('A'AsBinary)
Print cast ('A'AsBinary)
②
The database is not set to case
Label:Insert,select are not case-sensitive for database keywords.But the table name, field name. SQL Server is a database setting that determines whether a table name field name is case-sensitiveOracle uses double quotes to determineMySQL is dependent on configuration an
problem during data insertion :
Insert into collage values ('8', 'A ');
Insert into collage values ('9', 'A ');
Case sensitivity
Select * from a where a = 'abcde' collate chinese_prc_cs_ai -- case sensitive
Select * from a where a = 'abcde' collate chinese_prc_ci_ai --
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.