Showing posts with label sensitive. Show all posts
Showing posts with label sensitive. Show all posts

Wednesday, March 21, 2012

make XML column not case sensitive

Is there any way that an xml column in sql can be made to not be case sensitive?

So you can search for the text() of a node matching say 'open' (properties.exist('property[. = "open"]') and get all results back where the property text = "OPEN" or any other not case sensitive combination of "open".

Collations are not supported in SQL Server 2005 for XQuery. In order to perform your collation-sensitive comparison, you should promote the value out of the XML instance using the .value() method and perform the comparison in T-SQL.
|||

If you find that you like to see such functionality added in a future release, please file a request in the SQL Server Feedback Center @. http://lab.msdn.microsoft.com/productfeedback/

Best regards
Michael

sql

Monday, March 19, 2012

Make SQL Queries Case Sensitive

Hi,

I have an SQL Server 2000 database. There is a table for User Logins. I want the query to be executed as case sensitive. I mean if the database has a username like "USER1" and the user enters his username as "user1" then the login should fail.

So, Is there some way I can make SQL case sensitive? Please help

Regards

Vineed

This is a collation issue. Assuming your table name is UserTable and the field that holds username is UserName (varchar(50)), you can alter your table as follows:

Code Snippet

Alter Table UserTable Alter Column UserName (varchar(50) collate latin1_general_CS_AS)

If you want case insensitive, change CS to CI.

|||

Hi,

Thanks for your time. Really helped.

Thanks again

Regards

Vineed