Constructeur Table (Database, String, String)
Initialise une nouvelle instance de la classe Table sur la base de données spécifiée et qui a le nom et le schéma spécifiés.
Espace de noms : Microsoft.SqlServer.Management.Smo
Assembly : Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)
Syntaxe
'Déclaration
Public Sub New ( _
database As Database, _
name As String, _
schema As String _
)
'Utilisation
Dim database As Database
Dim name As String
Dim schema As String
Dim instance As New Table(database, _
name, schema)
public Table(
Database database,
string name,
string schema
)
public:
Table(
Database^ database,
String^ name,
String^ schema
)
new :
database:Database *
name:string *
schema:string -> Table
public function Table(
database : Database,
name : String,
schema : String
)
Paramètres
- database
Type : Microsoft.SqlServer.Management.Smo. . :: . .Database
Valeur de l'objet Database qui spécifie la base de données dans laquelle créer l'objet Table.
- name
Type : System. . :: . .String
Valeur String qui spécifie le nom du schéma pour la table à créer.
- schema
Type : System. . :: . .String
Valeur String qui spécifie le nom du schéma pour la table à créer.
Exemples
The following code example shows how to declare a new table on the specified database, with the specified name.
C#
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2008R2"];
Table tb = new Table(db, "Test Table", "Public");
Powershell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
#Define the Table
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "Test Table", "Public")
Voir aussi