Show tables in the database

Source: Internet
Author: User
Tags scalar
-- Display all user tables of the database
UseTest
Select*FromSysobjectsWhereType= 'U'
Go

Parameters:

Column name

Data Type

Description

Name

Sysname

Object Name

ID

Int

Object ID number

xtype

char (2)

object type. It can be one of the following object types:

AF = aggregate function (CLR)

C = check constraint

d = default value or default constraint

F = foreign key constraint

L = Log

fn = scalar function

FS = Program set (CLR) scalar functions

Ft = assembly (CLR) table valued functions

If = inline table functions

it = internal table

P = Stored Procedure

Pc = assembly (CLR) stored Procedure

PK = primary key constraint (type: K)

Rf = copy and filter the Stored Procedure

S = system table

Sn = synonym

sq = Service Queue

Ta = assembly (CLR) DML triggers

TF = table functions

TR = SQL DML triggers

TT = TABLE type

U = User table

uq = unique constraint (type: K)

V = view

X = Extended Stored Procedure

UID

Smallint

The schema ID of the object owner.

For databases upgraded from the old version of SQL Server, the schema ID is equal to the owner's user ID.

ImportantIf you use any of the following SQL Server DDL
Statement, you must use SYS. Objects
Directory view instead of SYS. sysobjects.Create | alter | drop
UserCreate | alter | drop roleCreate | alter | drop
Application roleCreate SchemaAlter authorization on
Object

If the number of users and roles exceeds 32,767, overflow or null is returned.

For more information, seeQuery the SQL Server System Directory.

Info

Smallint

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Status

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Base_schema_ver

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Replinfo

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Parent_obj

Int

ID of the parent object. For example, table ID (if the parent object is a trigger or constraint ).

Crdate

Datetime

Object creation date.

Ftcatid

Smallint

The full-text directory identifier of all user tables registered with full-text indexes. The value is 0 for all user tables not registered.

Schema_ver

Int

The version number that is added each time you change the schema of a table. Always Returns 0.

Stats_schema_ver

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Type

Char (2)

Object type. It can be one of the following values:

AF = aggregate function (CLR)

C = check Constraints

D = default value or default Constraint

F = foreign key constraint

Fn = scalar function

FS = assembly (CLR) scalar function

FT = assembly (CLR) Table value function if = inline Table Function

It-internal table

K = primary key or unique constraint

L = Log

P = Stored Procedure

PC = assembly (CLR) Stored Procedure

R = rule

Rf = copy and filter the Stored Procedure

S = system table

Sn = Synonym

Sq = Service Queue

Ta = assembly (CLR) DML trigger

TF = table functions

Tr = SQL DML trigger

Tt = table Type

U = User table

V = View

X = Extended Stored Procedure

Userstat

Smallint

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Sysstat

Smallint

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Indexdel

Smallint

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Refdate

Datetime

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Version

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Deltrig

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Instrig

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Updtrig

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Seltrig

Int

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

Category

Int

Used for publishing, binding, and identification.

Cache

Smallint

Marked as for reference only. Not supported. Future compatibility is not guaranteed.

 

More: http://msdn.microsoft.com/zh-cn/library/ms177596.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.