How to find out if a table is a system table

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

How to find out if a table is a system table

Post by jaska45 » Fri 08 Sep 2006 02:16

Hi,

TMsConnection.GetTableNames returns names of all tables in the database including the system tables (e.g. sysdiagrams).
How can I figure out what tables are system tables and what are normal tables?

Best regards,
Jaakko

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Mon 11 Sep 2006 13:08

TCustomDAConnection.GetTableNames returns only user tables. sysdiagrams table appears in the list because it is marked as user table. You can make sure of this by executing the following statement: SELECT name, xtype FROM sysobjects WHERE name = 'sysdiagrams'

jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

Post by jaska45 » Mon 11 Sep 2006 13:25

Thanks. However when I use Microsoft SQL Server Managerment Studio it shows that sysdiagams is a system table.

Best regards,
Jaakko

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Tue 12 Sep 2006 13:51

You are right. Microsoft SQL Server Management Studio shows sysdiagams as a system table.
Evidently this is peculiarity of Management Studio behaviour.

Post Reply