Problem solve Get help with specific problems with your technologies, process and projects.

Preventing users from having more than one login session open at once

Prevent simultaneous logins to your SQL Server database with this advice from SQL Server Security Expert Steven Andres.

I created a database in MS SQL Server 2000. Everything was working great until I found that a user can login to the server more than once at the same time. Is there a way to prevent this, especially the first login using a normal login screen and the second login using Query Analyzer?
SQL Server is a data repository and not a full access control system. Your database application should be the one in charge of controlling access to the back-end data. One popular way that I've seen this performed is by having the application login using one set of credentials and then managing the user credentials inside your custom application. This way, when a user attempts to login concurrently, your application can query a "currently logged in" users list and display the appropriate error message. The user's password won't allow him into Query Analyzer so there's no harm in attempting a connection.

Dig Deeper on SQL Server Database Modeling and Design

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.