views:

24

answers:

1

I have one database which contains username, password and IsActive (data type is "bit") columns.

My requirement is that I have to display the user details when the user name and password is correct and when the active column of that user is true.

How can I check these 3 columns in Sql Server 2005?

+2  A: 

How about something like the following?

SELECT username, password 
FROM UsersTable
WHERE IsActive > 0 AND username = 'admin' AND password = '1234'
Andreas Grech