[REPOST2] SMO Table Owner

S

Scott

Using SMO, how do I get a table's ower? I'm scripting out some tables to
disk based on the table's name, but I'm getting a clash on the file name
because the same table name exists with different owners. I want to encorporate
the owner's name into the file name to prevent such clashes.

Also, please let me know if there's a better place to post SMO questions.
The docs and other sources are still a bit sparse on info.

Thanks.
Scott C.
 
C

Cor Ligthert [MVP]

Scott,

Adonet is the System.Data namespace

SMO is the Microsoft.SQLServer namespace.

Therefore I would ask it to the newsgroup from the language I am using,
because it is in my idea more WMI related.

But that is only my idea feel free to ask it here.

Cor
 
K

Kevin Yu [MSFT]

Hi Scott,

You can use the Table.Schema property to get the owner of the table. For
more information, please check the following link:

http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.
scriptschemaobjectbase.schema.aspx

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top