Working with sql server metadata in c#

Are there any tools out there that encapsulate the retrieval of SQL Server metadata into a nice object model?

My immediate needs are to gather these things from SQL Server 2000-2008 R2:

  • Databases
  • Tables
  • Foreign key constraints
  • Triggers

So, maybe given a SqlConnection object, I could do things like this:

var dbs = conn.GetDatabases();
var db = dbs.Single(x => x.Name == "AdventureWorks");
var tables = db.GetTables();
var triggers = db.GetAllTriggers();

Of course, those examples would be very convenient, but any sort of object model would be better than what I'm doing now. Before I build my own, is there anything out there?


You might want to look at SQL Server Management Objects.

Need Your Help

Jtable row sorter causes IndexOutOfBoundsException

java swing jtable indexoutofboundsexception tablerowsorter

In my PhoneBook applcation after sorting by a column , when i remove a row and cal updateUI() i got a java.lang.IndexOutOfBoundsException in my model . But if not sorting there is no exeption

Can not import class from custom django package

python python-2.7 python-module

I am writing a custom Django module but I seem to have something wrong. I cannot import a class that lives in a certain file. I get the error

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.