I have a ms sql database I would like to make one colounm case sensitive it is a password colounm how can I do that

Posted on 2011-04-26
Last Modified: 2012-05-11
I have a ms sql database I would like to make one colounm case sensitive it is a password colounm how can I do that

ms sql server 2000
Question by:1030071002
    LVL 33

    Accepted Solution

    The column will store what ever you put in it (upper or lower case, or mixed), but to do a case-INsensitive compare, do this:

    declare @prmPassword varchar(128)
    select  @prmPassword = 'myTestPassword'

    select *
    from myTable
    where  @prmPassword = myPasswordColumn COLLATE Latin1_General_CS_AS
    LVL 6

    Assisted Solution

    ALTER TABLE ALTER COLUMN allows to change collation for a single column:

    alter table Foo alter column Bar ntext collate Latin1_General_CS_AS
    LVL 9

    Assisted Solution

    you can use collate at time comparison or make that column collation as case sensitive.


    it is suggestion

    do not store password in database as it is....
    you may use other options.

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now