find the names of the tables for a particular user

  • hai friends,i am new to this forum.

    can any body tell me how to find the names of the tables owned by the particular user in sql server and how to display the distinct object types owned by the particular user

    thanks

  • Objects such as tables aren't really owned by a user. They are owned by a particular schema. Schemas are owned by users.

    You can find out what schemas there are by querying the database's system schema view:

    SELECT *

    FROM <your database name>.Sys.schemas

    The principal_id value corrosponds to the principal_id of a database user, which you can find in the database's system database principal view:

    SELECT *

    FROM <your database name>.Sys.Database_principals

    I hope this helps.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply