Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2006, 02:37 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default datatype of sql

Hello Friends,
my question is :
in my login table i have two fields
UserName nvarchar(24),
password nvarchar(24)

if i enter password in uppercases then on login it also accepts password in lower cases. plz tell me what should be the correct daatype for this.
is there is any option available for that


thanks......
__________________
thanks......
 
Old December 28th, 2006, 04:44 AM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

since you're decide to use nvarchar datatype (char like data type) you must consider witch of SQL Collation options you want to apply to that datatype. In this case as I can see you want it to be case sensitive (CS) (something like "Latin1_General_CS_AS") and therefore you should pick up right collation.

Just, have in mind that both comparing and sorting of char like datatypes uses collation rules that you have specified..





 
Old January 3rd, 2007, 04:52 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

there is also a server parameter to treat capital letters the same as lower case, problem could be as mrJagodic describes or this.

 
Old January 5th, 2007, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, you can configure your server to be case sensitive or not. That should solve your problem.

cheers.

_________________________
- Vijay G
Strive for Perfection
 
Old January 5th, 2007, 10:22 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Ooooohhhh... If you want case sensitivety, do it by the column using COLLATION... don't make the whole server case sensitive. I've worked for two clients that did and it was a bloody nightmare.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle to SQL Server DataType Mapping maulik33 SQL Language 0 November 1st, 2007 02:48 PM
Sql servere datatype monika.vasvani SQL Server 2000 2 December 14th, 2006 03:11 PM
SQL Text Datatype bekim ASP.NET 1.0 and 1.1 Professional 2 March 28th, 2006 12:05 AM
SQL Datatype rain_uk SQL Server ASP 2 July 5th, 2005 01:34 AM
sql datatype change be changed mateenmohd SQL Server 2000 3 July 18th, 2003 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.