Table.Owner 속성

Gets or sets the owner of the table.

이 API는 CLS 규격이 아닙니다. 

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
<SfcReferenceAttribute(GetType(DatabaseRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/Role[@Name = '{2}']",  _
    )> _
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Design)> _
<SfcReferenceAttribute(GetType(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']",  _
    )> _
<CLSCompliantAttribute(False)> _
<SfcReferenceAttribute(GetType(ApplicationRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/ApplicationRole[@Name = '{2}']",  _
    )> _
Public Property Owner As String 
    Get 
    Set
‘사용 방법
Dim instance As Table 
Dim value As String 

value = instance.Owner

instance.Owner = value
[SfcReferenceAttribute(typeof(DatabaseRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/Role[@Name = '{2}']", 
    )]
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)]
[SfcReferenceAttribute(typeof(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )]
[CLSCompliantAttribute(false)]
[SfcReferenceAttribute(typeof(ApplicationRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/ApplicationRole[@Name = '{2}']", 
    )]
public string Owner { get; set; }
[SfcReferenceAttribute(typeof(DatabaseRole), L"Server[@Name = '{0}']/Database[@Name = '{1}']/Role[@Name = '{2}']", 
    )]
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase|SfcPropertyFlags::Design)]
[SfcReferenceAttribute(typeof(User), L"Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )]
[CLSCompliantAttribute(false)]
[SfcReferenceAttribute(typeof(ApplicationRole), L"Server[@Name = '{0}']/Database[@Name = '{1}']/ApplicationRole[@Name = '{2}']", 
    )]
public:
virtual property String^ Owner {
    String^ get () sealed;
    void set (String^ value) sealed;
}
[<SfcReferenceAttribute(typeof(DatabaseRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/Role[@Name = '{2}']", 
    )>]
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)>]
[<SfcReferenceAttribute(typeof(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )>]
[<CLSCompliantAttribute(false)>]
[<SfcReferenceAttribute(typeof(ApplicationRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/ApplicationRole[@Name = '{2}']", 
    )>]
abstract Owner : string with get, set
[<SfcReferenceAttribute(typeof(DatabaseRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/Role[@Name = '{2}']", 
    )>]
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)>]
[<SfcReferenceAttribute(typeof(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )>]
[<CLSCompliantAttribute(false)>]
[<SfcReferenceAttribute(typeof(ApplicationRole), "Server[@Name = '{0}']/Database[@Name = '{1}']/ApplicationRole[@Name = '{2}']", 
    )>]
override Owner : string with get, set
final function get Owner () : String 
final function set Owner (value : String)

속성 값

유형: System.String
A String value that specifies the owner of the table.

구현

ITableOptions.Owner

The following code example lists the owners of each table in the AdventureWorks2012 database.

C#

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

foreach (Table tb in db.Tables) 
{
   Console.WriteLine("The " + tb.Name + " table is owned by " + tb.Owner);
}

Powershell

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

Foreach ($tb in $db.Tables) 
{
   Write-Host "The" $tb.Name "table is owned by" $tb.Owner
}

참고 항목

참조

Table 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

테이블

CREATE TABLE(Transact-SQL)