Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Creating Table with Case Sensitive Column

Author  Topic 

Spider1362
Starting Member

2 Posts

Posted - 2012-12-12 : 07:15:11
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
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-12-12 : 07:18:07
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

2 Posts

Posted - 2012-12-12 : 07:36:34
Thanks for your rapid response Nigel :)
Go to Top of Page
   

- Advertisement -