Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to get the list of master tables in a database

Author  Topic 

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2013-01-23 : 04:59:53
Hello all,

How i can get the list of master tables in databse. here i need only master tables not transaction tables or child tables...

suggest me

P.V.P.MOhan

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-01-23 : 05:32:56
Didn't quite get what you meant by master tables, transaction tables, child tables etc.
All of these will give you information about base user tables:

INFORMATION_SCHEMA.TABLES
sys.tables
sys.objects where [type] = 'U'
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-23 : 07:13:43
quote:
Originally posted by mohan123

Hello all,

How i can get the list of master tables in databse. here i need only master tables not transaction tables or child tables...

suggest me

P.V.P.MOhan


probably you meant system tables

SELECT *
FROM sys.objects
WHERE type='u'
AND is_ms_shipped=1


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-01-23 : 08:08:25
Run this procedure to get all parent table names( take only the tablenames which has oSequence as 1)

EXEC sp_msdependencies @intrans = 1

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-23 : 11:00:23
quote:
Originally posted by bandi

Run this procedure to get all parent table names( take only the tablenames which has oSequence as 1)

EXEC sp_msdependencies @intrans = 1

--
Chandu


Using undocumented features can have undesirable effects as its implementation may change without notice. Its not safe to use this on production environment.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -