Therefore, to find a list of user-created tables (thus ignoring system tables), we’ll need to find results where the xtype column (which specifies the object type for that row) is equal to the value U, which stands for user table. The SYSOBJECTS table houses a couple dozen columns of data since it must hold information about virtually everything added to the server over time. SYS.SYSOBJECTS contains a row for every object that has been created in the database, including stored procedures, views, and user tables (which are an important to distinguish from system tables.) Right-click on Database Diagram folder and select New Database Diagram. Allow the pop up which checks for the permission to create a database diagram. Expand the database and right-click on Database Diagram. Listing Tables in SQL Server 2000įor older versions of SQL Server (such as SQL Server 2000, though this method is also supported in SQL Server 2005 for backward compatibility), you’ll need to query the SYS.SYSOBJECTS metadata view. Navigate to Object Explorer in SQL Server Management Studio. Below we’ll briefly examine the TSQL statements that can be used to retrieve a table list for both the older SQL Server 2000 and the newer 2005 version or beyond. ![]() ![]() ![]() ![]() Depending on the version of SQL Server you are running, the method for querying and returning a list of all user-created tables may differ slightly.
0 Comments
Leave a Reply. |