SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Creating Table with Case Sensitive Column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Spider1362
Starting Member

Ireland
2 Posts

Posted - 12/12/2012 :  07:15:11  Show Profile  Reply with Quote
Hi All. I'm creating a Users Table which contains a Password field that I wish to make case sensitive. By default the database I'm working on is Case Insensitive. I cannot access the server with a management tool so this has to be done through code. I know that I have to use the Collate keyword but I'm unsure of the correct syntax.

My create statement is as follows;

CREATE TABLE AppUsers(UserId smallint NOT NULL,UserName varchar(255),UserPword varchar(8))

I need the UserPword Column to be Case Sensitive.

Thanks in advance for any help.

Pat.

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/12/2012 :  07:18:07  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
CREATE TABLE AppUsers(UserId smallint NOT NULL,UserName varchar(255),UserPword varchar(8) collate sql_latin1_general_cp1_cs_as)


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Spider1362
Starting Member

Ireland
2 Posts

Posted - 12/12/2012 :  07:36:34  Show Profile  Reply with Quote
Thanks for your rapid response Nigel :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.74 seconds. Powered By: Snitz Forums 2000