Server.EnumStartupProcedures Server.EnumStartupProcedures Server.EnumStartupProcedures Method

Definition

Enumerates a list of startup procedures.

public:
 System::Data::DataTable ^ EnumStartupProcedures();
public System.Data.DataTable EnumStartupProcedures ();
Public Function EnumStartupProcedures () As DataTable
Returns

A DataTable object value that contains a list startup procedures for the instance of SQL Server. The table describes the different columns of the returned DataTable.

Column
Data type
Description
Name
String The name of the startup procedure.
Schema
String The schema associated with the startup procedure.

Examples

Visual Basic

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$arg = [Microsoft.SqlServer.Management.Smo.ServerPermission]::CreateEndpoint  

$sps = new-object Microsoft.SqlServer.Management.Smo.ServerPermissionSet([Microsoft.SqlServer.Management.Smo.ServerPermission]::CreateEndpoint)  
$sps.Add([Microsoft.SqlServer.Management.Smo.ServerPermission]::AlterAnyEndpoint)  
$spis = $srv.EnumServerPermissions("vGrantee", $sps)  
Write-Host "=================Before revoke==========================="  
Foreach ($spi In $spis)  
{  
   Write-Host $spi.Grantee "has" $spi.PermissionType " permission."  
}  
Write-Host " "  
$sps.Remove([Microsoft.SqlServer.Management.Smo.ServerPermission]::CreateEndpoint)  

Remarks

This method is used to display the Transact-SQL procedures that run automatically when the instance of SQL Server is started.

Applies to

See Also