DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

17
kicks
published 1 year, 11 months ago, submitted by fatdaveh 1 year, 11 months ago

geekzilla.co.uk — How to select information about columns in a table using SQL Server.

Add a comment 3 comments | category: | Views: 5 | Get KickIt image code
tags: , , , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

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
posted by DamienG DamienG 1 year, 11 months ago
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
posted by DamienG DamienG 1 year, 11 months ago
Damien: Wish I had seen INFORMATION_SCHEMA before.

When I get some time I will change the example accordingly

Good info, thanks
posted by fatdaveh 1 year, 11 months ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge