How to find out the orphan tables in the database?

  • Hello team,

    I run few analysis on the tables which in turn creates some more tables in the same database. After reviewing the new tables and generating the reports, I usually delete the tables through the application (custom-application).

    What sometime I face that all of the tables are not deleted of a specific analysis. My question to you all is - Is there any way / script that I can run on the database and find out if there are any orphan tables in the database.

    I have a specific naming convention while naming the tables and there are 15 tables.

    For example, GV_00001_A

    GV_00002_A

    GV_00003_A

    if any of the table is not deleted, how I can find the table?

    Thanks in advance.

    Sanjeev.

  • select * FROM sys.objects

    where type ='U' and [name] like 'GV_%_A'

    This will give you the table information that is with your naming convention.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply