dprotonentis
MIS
I have the daunting task of converting an existing database to a new database structure. A conversion from one system to another. The database contains more than 500 tables and in excess of half a million records.
However, several of the tables in the database are empty. I'm trying to extract the data structure of the existing database while only extracting thoses tables that actually have data in them.
I am using the following SQL query:
SELECT o.name AS TableName, c.name AS ColumName
FROM syscolumns c JOIN sysobjects o
ON c.id = o.id
WHERE o.type = 'u'AND o.name NOT LIKE 'dt%'
ORDER BY o.name, c.name
This grabs all the tables and lists all their column names, excluding the dtproperties table. How can I modify this query to display only the table names and column names of tables with data?
However, several of the tables in the database are empty. I'm trying to extract the data structure of the existing database while only extracting thoses tables that actually have data in them.
I am using the following SQL query:
SELECT o.name AS TableName, c.name AS ColumName
FROM syscolumns c JOIN sysobjects o
ON c.id = o.id
WHERE o.type = 'u'AND o.name NOT LIKE 'dt%'
ORDER BY o.name, c.name
This grabs all the tables and lists all their column names, excluding the dtproperties table. How can I modify this query to display only the table names and column names of tables with data?