Search this insane blog:

Sunday, July 5, 2009

What are the columns in that table?

Oh my.
I wish I found this many years earlier.

use MyDatabase
go

SELECT column_name, data_type
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'MyTable'
ORDER
BY ORDINAL_POSITION




replace MyDatabase and MyTable with your database and table values

No comments:

Post a Comment