Aracılığıyla paylaş


User Class

The User object represents a SQL Server user.

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Bildirim
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None Or AutomatedPolicyEvaluationMode.Enforce Or AutomatedPolicyEvaluationMode.CheckOnChanges Or AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
<StateChangeEventAttribute("CREATE_USER", "USER", "GROUP USER")> _
<StateChangeEventAttribute("CREATE_USER", "USER", "SQL USER")> _
<StateChangeEventAttribute("ALTER_USER", "USER", "SQL USER")> _
<StateChangeEventAttribute("CREATE_USER", "USER", "WINDOWS USER")> _
<StateChangeEventAttribute("ALTER_USER", "USER", "WINDOWS USER")> _
<StateChangeEventAttribute("ALTER_USER", "USER", "CERTIFICATE USER")> _
<PhysicalFacetAttribute> _
<StateChangeEventAttribute("CREATE_USER", "USER", "CERTIFICATE USER")> _
<StateChangeEventAttribute("ALTER_USER", "USER", "GROUP USER")> _
<StateChangeEventAttribute("CREATE_USER", "USER", "ASYMMETRIC KEY USER")> _
<StateChangeEventAttribute("ALTER_USER", "USER", "ASYMMETRIC KEY USER")> _
Public NotInheritable Class User
    Inherits ScriptNameObjectBase
    Implements IObjectPermission, ICreatable, IDroppable, IAlterable, _
    IRenamable, IExtendedProperties, IScriptable
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None|AutomatedPolicyEvaluationMode.Enforce|AutomatedPolicyEvaluationMode.CheckOnChanges|AutomatedPolicyEvaluationMode.CheckOnSchedule)] 
[StateChangeEventAttribute("CREATE_USER", "USER", "GROUP USER")] 
[StateChangeEventAttribute("CREATE_USER", "USER", "SQL USER")] 
[StateChangeEventAttribute("ALTER_USER", "USER", "SQL USER")] 
[StateChangeEventAttribute("CREATE_USER", "USER", "WINDOWS USER")] 
[StateChangeEventAttribute("ALTER_USER", "USER", "WINDOWS USER")] 
[StateChangeEventAttribute("ALTER_USER", "USER", "CERTIFICATE USER")] 
[PhysicalFacetAttribute] 
[StateChangeEventAttribute("CREATE_USER", "USER", "CERTIFICATE USER")] 
[StateChangeEventAttribute("ALTER_USER", "USER", "GROUP USER")] 
[StateChangeEventAttribute("CREATE_USER", "USER", "ASYMMETRIC KEY USER")] 
[StateChangeEventAttribute("ALTER_USER", "USER", "ASYMMETRIC KEY USER")] 
public sealed class User : ScriptNameObjectBase, IObjectPermission, ICreatable, IDroppable, 
    IAlterable, IRenamable, IExtendedProperties, IScriptable
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::None|AutomatedPolicyEvaluationMode::Enforce|AutomatedPolicyEvaluationMode::CheckOnChanges|AutomatedPolicyEvaluationMode::CheckOnSchedule)] 
[StateChangeEventAttribute(L"CREATE_USER", L"USER", L"GROUP USER")] 
[StateChangeEventAttribute(L"CREATE_USER", L"USER", L"SQL USER")] 
[StateChangeEventAttribute(L"ALTER_USER", L"USER", L"SQL USER")] 
[StateChangeEventAttribute(L"CREATE_USER", L"USER", L"WINDOWS USER")] 
[StateChangeEventAttribute(L"ALTER_USER", L"USER", L"WINDOWS USER")] 
[StateChangeEventAttribute(L"ALTER_USER", L"USER", L"CERTIFICATE USER")] 
[PhysicalFacetAttribute] 
[StateChangeEventAttribute(L"CREATE_USER", L"USER", L"CERTIFICATE USER")] 
[StateChangeEventAttribute(L"ALTER_USER", L"USER", L"GROUP USER")] 
[StateChangeEventAttribute(L"CREATE_USER", L"USER", L"ASYMMETRIC KEY USER")] 
[StateChangeEventAttribute(L"ALTER_USER", L"USER", L"ASYMMETRIC KEY USER")] 
public ref class User sealed : public ScriptNameObjectBase, IObjectPermission, ICreatable, IDroppable, 
    IAlterable, IRenamable, IExtendedProperties, IScriptable
/** @attribute EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None|AutomatedPolicyEvaluationMode.Enforce|AutomatedPolicyEvaluationMode.CheckOnChanges|AutomatedPolicyEvaluationMode.CheckOnSchedule) */ 
/** @attribute StateChangeEventAttribute("CREATE_USER", "USER", "GROUP USER") */ 
/** @attribute StateChangeEventAttribute("CREATE_USER", "USER", "SQL USER") */ 
/** @attribute StateChangeEventAttribute("ALTER_USER", "USER", "SQL USER") */ 
/** @attribute StateChangeEventAttribute("CREATE_USER", "USER", "WINDOWS USER") */ 
/** @attribute StateChangeEventAttribute("ALTER_USER", "USER", "WINDOWS USER") */ 
/** @attribute StateChangeEventAttribute("ALTER_USER", "USER", "CERTIFICATE USER") */ 
/** @attribute PhysicalFacetAttribute() */ 
/** @attribute StateChangeEventAttribute("CREATE_USER", "USER", "CERTIFICATE USER") */ 
/** @attribute StateChangeEventAttribute("ALTER_USER", "USER", "GROUP USER") */ 
/** @attribute StateChangeEventAttribute("CREATE_USER", "USER", "ASYMMETRIC KEY USER") */ 
/** @attribute StateChangeEventAttribute("ALTER_USER", "USER", "ASYMMETRIC KEY USER") */ 
public final class User extends ScriptNameObjectBase implements IObjectPermission, ICreatable, 
    IDroppable, IAlterable, IRenamable, IExtendedProperties, IScriptable
EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None|AutomatedPolicyEvaluationMode.Enforce|AutomatedPolicyEvaluationMode.CheckOnChanges|AutomatedPolicyEvaluationMode.CheckOnSchedule) 
StateChangeEventAttribute("CREATE_USER", "USER", "GROUP USER") 
StateChangeEventAttribute("CREATE_USER", "USER", "SQL USER") 
StateChangeEventAttribute("ALTER_USER", "USER", "SQL USER") 
StateChangeEventAttribute("CREATE_USER", "USER", "WINDOWS USER") 
StateChangeEventAttribute("ALTER_USER", "USER", "WINDOWS USER") 
StateChangeEventAttribute("ALTER_USER", "USER", "CERTIFICATE USER") 
PhysicalFacetAttribute 
StateChangeEventAttribute("CREATE_USER", "USER", "CERTIFICATE USER") 
StateChangeEventAttribute("ALTER_USER", "USER", "GROUP USER") 
StateChangeEventAttribute("CREATE_USER", "USER", "ASYMMETRIC KEY USER") 
StateChangeEventAttribute("ALTER_USER", "USER", "ASYMMETRIC KEY USER") 
public final class User extends ScriptNameObjectBase implements IObjectPermission, ICreatable, 
    IDroppable, IAlterable, IRenamable, IExtendedProperties, IScriptable

Remarks

To get User object properties, users can be a member of the public fixed server role.

To set User object properties, uses must have ALTE ANY USER permission on the database or be a member of the db_owner fixed database role.

To change the default schema, users must have ALTER permission on the specified user or be the owner of the user.

To create or drop a user, users must have ALTER ANY USER permission on the fixed server role or be a member of the db_owner fixed database role.

To grant, deny, or revoke permission on the specified user to other users, users must have CONTROL permission on the specified user.

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.