Wednesday 7 July, 2010

Hi all,
Last night, when i was dealing with some server side error with my module of dotnetnuke and using the SQL page of the dotnetnuke, i was trying to access structure of an sql table, i search throug the web and here is what i get:
1)using a select statement:

  1. SELECT
    *
  2. FROM INFORMATION_SCHEMA.COLUMNS
  3. WHERE TABLE_CATALOG = 'Database name' AND
  4. TABLE_NAME = 'Table Name'

This will display a nice table formated output of the columns with all the data associated with it.
2)Another way is:

  1. exec
    sp_columns TableName

No comments:

Post a Comment