I will say ...

I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

Wednesday, December 16, 2009

Get SQL Database Table Information.

Couple of days ago one of my friends asked me that, why we always use ADO.Net class library to get any SQL Tables information runtime! SQL Server provides several “standard” techniques for it. So I decided to try it and I found it’s really cool and I believe that it is always better to use the standard techniques provided by SQL Server where possible.

This is easy enough to do with cursors and dynamic SQL, but after looking at how “sp_ spaceused” worked and how SMO gets the same information, I decided that I could write it without either.

Even better, once I wrote it though, I realized that it could easily be rewritten as a StoredProcedure, now I could reuse it by joining it with other tables and views in new queries or procedures whenever I wanted.

This article will demonstrate how we can view the Table information of SQL server database.

Click to view the article.

No comments:

Post a Comment