Table.FakeSystemTable Property


Gets the Boolean value that specifies whether the table references a system table.

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

[SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase)]
public bool FakeSystemTable { get; }

Property Value

Type: System.Boolean

A Boolean value that specifies the whether the table references a system table.

If True, the table references a system table. Otherwise, False (default).

The FakeSystemTable property specifies whether the Table object references a SQL Server system-defined table that is not implemented as a base, view, or table.

The following code example creates a new table, and displays the FakeSystemTable.


Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];

Table tb = new Table(db, "Test Table");
Column col1 = new Column(tb, "Name", DataType.NChar(50));
Column col2 = new Column(tb, "ID", DataType.Int);


if (tb.FakeSystemTable = true)
   Console.WriteLine("The table is a system table);
   Console.WriteLine("The table is not a system table);


$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2012")

#Create the Table
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "Test Table")
$col1 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "Name", [Microsoft.SqlServer.Management.Smo.DataType]::NChar(50))
$col2 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "ID", [Microsoft.SqlServer.Management.Smo.DataType]::Int)

If ($tb.FakeSystemTable -eq $TRUE)
   Write-Host "The table is a system table."
   Write-Host "The table is not a system table."
Return to top