Database schema
-
Hi all, In my .NET application i want to read the sql server database schema(Table names,triggers attached to tables etc). Once user selects the database (sql server) to connect to, i will open the connection and show to user list of tables available in the database. Is there any way of reading the database schema after opening connection to the database. Thanks in advance, Tushar Mahajan.
-
Hi all, In my .NET application i want to read the sql server database schema(Table names,triggers attached to tables etc). Once user selects the database (sql server) to connect to, i will open the connection and show to user list of tables available in the database. Is there any way of reading the database schema after opening connection to the database. Thanks in advance, Tushar Mahajan.
The query you need to run is:
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
The query you need to run is:
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
Thanks Colin it is returning all Table Names. For triggers i am executing 'sp_helptrigger' stored procedure with table Name as a parameter.It returns all the triggers and their types for that table. Thanks, Tushar Mahajan.