Friday May 6th

Thursday May 5th

Wednesday May 4th

Select Column Information using SQL Server

How to select information about columns in a table using SQL Server.

3 comments

Selecting directly from the system tables is unsupported by Microsoft and is exactly why they created the sp_help stored procedure and it's associates.

[)amien

Alternatively SQL 2005 adds metadata support for tables and columns using the syntax:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'Products';

Where Products is the table you want.

[)amien

Damien: Wish I had seen INFORMATION_SCHEMA before.

When I get some time I will change the example accordingly

Good info, thanks

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network