Login Object

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The Login object exposes the attributes of a single SQL Server Authentication record.

현재 개체를 보여 주는 SQL-DMO 개체 모델

Properties

Database Property

Name Property

DenyNTLogin Property

NTLoginAccessType Property

Language Property

SystemObject Property

LanguageAlias Property

Type Property (Login)

Methods

EnumDatabaseMappings Method

Remove Method (Objects)

GetUserName Method

Script Method

IsMember Method

SetPassword Method

ListMembers Method (Login, User)

 

주의

Microsoft SQL Server uses two ways to validate connections to SQL Server databases: Windows Authentication and SQL Server Authentication. SQL Server Authentication uses login records to validate the connection. A Login object exposes a SQL Server login record.

With a Login object, you can:

  • Create a SQL Server login record for a SQL Server Authentication connection.

  • Set the attributes of a SQL Server login record, such as the password or the default database for the login.

  • Determine the role membership of a SQL Server login.

  • Remove a login record from SQL Server, disabling its use.

    [!참고] To view, create, or remove SQL Server logins by using the Login object, the connected user must be a member of the SQL Server securityadmin fixed server role.

The Name property of a Login object uses the SQL Server data type sysname. The value of the Name property must be unique for an instance of SQL Server.

A SQL Server login is created with no password and no rights to any database on the server. After successful creation of a SQL Server login, you can use the SetPassword method of the Login object to assign a password to the login. Use the Database User object and the Users collection to grant login access to server resources.

To add a login to a server running SQL Server

  1. Create a Login object.

  2. Set the Name property.

  3. Set the Type property. By default, a login is created for use by SQL Server Authentication. Alternately, specify the login type to map a Windows user or group.

  4. Add the Login object to the Logins collection of a connected SQLServer object to create the SQL Server login.

[!참고] The Login object is compatible with instances of SQL Server versions 7.0 and later. However, the Login2 object extends the functionality of the Login object for use with features that were introduced in SQL Server 2000.

참고 항목

참조

Login2 Object

관련 자료

Notification Services 보안 설정

도움말 및 정보

SQL Server 2005 지원 받기