Partilhar via


Classe StoredProcedure

The StoredProcedure object represents a SQL Server stored procedure.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)

Sintaxe

'Declaração
<StateChangeEventAttribute("RENAME", "PROCEDURE")> _
<StateChangeEventAttribute("CREATE_PROCEDURE", "PROCEDURE")> _
<StateChangeEventAttribute("ALTER_PROCEDURE", "PROCEDURE")> _
<PhysicalFacetAttribute(PhysicalFacetOptions.ReadOnly)> _
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None Or AutomatedPolicyEvaluationMode.Enforce Or AutomatedPolicyEvaluationMode.CheckOnChanges Or AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
Public NotInheritable Class StoredProcedure _
    Inherits ScriptSchemaObjectBase _
    Implements IObjectPermission, ICreatable, IAlterable, IDroppable,  _
    IRenamable, IExtendedProperties, IScriptable, ITextObject
'Uso
Dim instance As StoredProcedure
[StateChangeEventAttribute("RENAME", "PROCEDURE")]
[StateChangeEventAttribute("CREATE_PROCEDURE", "PROCEDURE")]
[StateChangeEventAttribute("ALTER_PROCEDURE", "PROCEDURE")]
[PhysicalFacetAttribute(PhysicalFacetOptions.ReadOnly)]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None|AutomatedPolicyEvaluationMode.Enforce|AutomatedPolicyEvaluationMode.CheckOnChanges|AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class StoredProcedure : ScriptSchemaObjectBase, 
    IObjectPermission, ICreatable, IAlterable, IDroppable, IRenamable, 
    IExtendedProperties, IScriptable, ITextObject
[StateChangeEventAttribute(L"RENAME", L"PROCEDURE")]
[StateChangeEventAttribute(L"CREATE_PROCEDURE", L"PROCEDURE")]
[StateChangeEventAttribute(L"ALTER_PROCEDURE", L"PROCEDURE")]
[PhysicalFacetAttribute(PhysicalFacetOptions::ReadOnly)]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::None|AutomatedPolicyEvaluationMode::Enforce|AutomatedPolicyEvaluationMode::CheckOnChanges|AutomatedPolicyEvaluationMode::CheckOnSchedule)]
public ref class StoredProcedure sealed : public ScriptSchemaObjectBase, 
    IObjectPermission, ICreatable, IAlterable, IDroppable, IRenamable, 
    IExtendedProperties, IScriptable, ITextObject
[<SealedAttribute>]
[<StateChangeEventAttribute("RENAME", "PROCEDURE")>]
[<StateChangeEventAttribute("CREATE_PROCEDURE", "PROCEDURE")>]
[<StateChangeEventAttribute("ALTER_PROCEDURE", "PROCEDURE")>]
[<PhysicalFacetAttribute(PhysicalFacetOptions.ReadOnly)>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.None|AutomatedPolicyEvaluationMode.Enforce|AutomatedPolicyEvaluationMode.CheckOnChanges|AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
type StoredProcedure =  
    class
        inherit ScriptSchemaObjectBase
        interface IObjectPermission
        interface ICreatable
        interface IAlterable
        interface IDroppable
        interface IRenamable
        interface IExtendedProperties
        interface IScriptable
        interface ITextObject
    end
public final class StoredProcedure extends ScriptSchemaObjectBase implements IObjectPermission, ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, IScriptable, ITextObject

Comentários

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

To set StoredProcedure object properties, users must have ALTER permission on the stored procedure, or be a member of db_owner fixed database role.

To create a stored procedure, users must have CREATE PROCEDURE permission on the parent database or be a member of the db_owner fixed database role.

To drop a stored procedure, users must have CONTROL permission on the stored procedure or be a member of the db_owner fixed database role.

Thread Safety

Qualquer membro público estático (Compartilhado no Microsoft Visual Basic) desse tipo é seguro para operações multi-threaded. Não há garantia de que qualquer membro de instância seja seguro para threads.

Segurança de thread

Quaisquer membros static (Shared no Visual Basic) públicos deste tipo são thread-safe. Não há garantia de que qualquer membro de instância seja thread-safe.