Saturday, September 14, 2013

To find the list of table names on database

select name,type from sysobjects where type='U'
and name not like '%OracleGG%' and name not like '%sys%'
and name not in ('MSpeer_conflictdetectionconfigrequest',
'MSpeer_conflictdetectionconfigresponse',
'MSpeer_lsns',
'MSpeer_originatorid_history',
'MSpeer_request',
'MSpeer_response',
'MSpeer_topologyrequest',
'MSpeer_topologyresponse',
'MSpub_identity_range',
'dtproperties',
'captured_columns',
'change_tables',
'change_tables',
'ddl_history',
'index_columns',
'lsn_time_mapping')
order by name


SELECT * FROM information_schema.Tables where TABLE_TYPE='BASE TABLE' and
table_schema not in ('cdc') and Table_name not like '%sys%'
and table_name not in ('MSpeer_conflictdetectionconfigrequest',
'MSpeer_conflictdetectionconfigresponse',
'MSpeer_lsns',
'MSpeer_originatorid_history',
'MSpeer_request',
'MSpeer_response',
'MSpeer_topologyrequest',
'MSpeer_topologyresponse',
'MSpub_identity_range',
'dtproperties'
)
order by table_name

exec sp_msforeachtable 'print ''?'''

dbcc loginfo

No comments:

Post a Comment