-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: SwapnilDeshmukh
Message 6 in Discussion
New Message on MumbaiUserGroup
Case Sensitive (asp.net)
Reply
Reply to Sender
Recommend
Message 5 in Discussion
From:
SwapnilDeshmukh
Hi Bobby,
This particular solution i have tested with SQL Server2000. The solution is
the use of COLLATE caluse. COLLATE caluse allow us to specify a particular
collation for an expression, it checks for the case sensitiveness in the
search query. The following example uses SQL_Latin1_General_CP1_CS_AS for
collation. This is for English data only for Non English data u have to
choose aan appropriate one.
for example we have a table called User.
This table has two fields User_ID and User_Password
It has two records
User_ID User_Password
S1 Swapnil
S2 SeLf
Now the query which will check with case sensitive is
Declare @UserID char(8),@UserPassword varchar(10)
set @UserID = 'S1'
set @UserPassword = 'swapnil'
IF EXISTS
(
SELECT 1
FROM user_master
WHERE User_ID = @UserID COLLATE SQL_Latin1_General_CP1_CS_AS
AND User_Password = @UserPassword COLLATE
SQL_Latin1_General_CP1_CS_AS
)
BEGIN
PRINT 'User Found!'
END
ELSE
BEGIN
PRINT 'Invalid User ID or Password!'
END
GO
this query will give u the correct answer
Regards
Swapnil Deshmukh
View other groups in this category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]