Getting metadata from SQL Server
-
Hi all I wonder if it is possible to get information about a specific SQL Server database? What I need is a way to get a list of all the tables in the database and also the names of all columns in all tables. I also need a way to get the datatype of each column. Is this possible in SQL Server? (I am using MSDE)
-
Hi all I wonder if it is possible to get information about a specific SQL Server database? What I need is a way to get a list of all the tables in the database and also the names of all columns in all tables. I also need a way to get the datatype of each column. Is this possible in SQL Server? (I am using MSDE)
Yes - the system tables (e.g. Sysobjects) hold details of the tables, views etc. and you can get the SQL of stored procedures and views from syscomments '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
Yes - the system tables (e.g. Sysobjects) hold details of the tables, views etc. and you can get the SQL of stored procedures and views from syscomments '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
SQL DMO is a great library for getting Sql Server metadata. See: http://www.sqlteam.com/item.asp?ItemID=9093[^]. It gives you a bit more flexibility than running queries like "select * from sysobjects where type='u'" and so on. It gives you a navigable heirarchy as well. You can get schema info using the .NET framework, but for what you're describing, I'd use DMO. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
SQL DMO is a great library for getting Sql Server metadata. See: http://www.sqlteam.com/item.asp?ItemID=9093[^]. It gives you a bit more flexibility than running queries like "select * from sysobjects where type='u'" and so on. It gives you a navigable heirarchy as well. You can get schema info using the .NET framework, but for what you're describing, I'd use DMO. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
True - but since most enterprise class database platforms have their own versions of the system tables you can wrte a plug-in based system that could be platform independent - rather like the Database Build Wizard[^] '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd