I n SQL Server, much like other services with users, login accounts can be enabled or disabled. An enabled login can be authenticated and allowed access to database resources. A disabled login is not allowed to establish a connection to the SQL Server instance. For example, let's create a login called sumank . CREATE LOGIN sumank WITH PASSWORD = 'ipl5@2012' ,DEFAULT_DATABASE = AdventureWorks USE AdventureWorks; CREATE USER sumank In the first statement, the sumank login was created with a fairly complex password and a default database of AdventureWorks. Afterward, we switch to the AdventureWorks database and create a new user for the database. If we attempt to login to SQL Server using these credentials, we can. Next let's disable the login with the following statement. ALTER LOGIN sumank DISABLE If someone attempts to login to SQL Server using the sumank login, the connection attempt is rejected and Error 18470 is returned - &q
Connecting, Sharing and Discovering