Discussion Locked

MSSQL 2000 - Select Column

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Anyone know how to use a SQL stmt to auto retrieve the first and second column from a table
(any table)

Select ... , ... from Orders etc

is there column(1) function ?

2 replies

by toni.myyrylainen

Hi, I'm not quite a sure what you mean "to auto retrieve the first and second column from a table".. You need a query which gets data of the first and the second column from a random table from your database? If this is the case then you need to dig in to the system tables of your db (sysobjects/syscolumns).

Further information can be found from the MS Books Online html-help and it can be downloaded for free (http://www.microsoft.com/sql/techinfo/productdoc/2000/books.mspx).

This discussion is closed to new replies.