Click here to Skip to main content
16,020,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Retrieve database table names, column names respectively and how to export total database to excel sheets using c#
Posted

1 solution

Use this Query to Retrieve database table names, column names
SQL
SELECT table_name=sysobjects.name,
         column_name=syscolumns.name,
         datatype=systypes.name,
         length=syscolumns.length
    FROM sysobjects 
    JOIN syscolumns ON sysobjects.id = syscolumns.id
    JOIN systypes ON syscolumns.xtype=systypes.xtype
   WHERE sysobjects.xtype='U'
ORDER BY sysobjects.name,syscolumns.colid

to export dataset to excel see
Export Database to Excel, PDF, HTML, RTF, XML, etc. for ASP.NET without Automation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900