-
Selecting by column number, MS SQL 2000
Ok, so I need to select data from a column by its number. something like:
SELECT COLUMN_NAME(@int_col_num) FROM MY_TABLE WHERE CONDITION = 'whatever'
The problem being that there is no function called COLUMN_NAME, the closest thing I could find is COL_NAME but for some reason that won't work. when I do something like:
SELECT COL_NAME(@table_id, @int) FROM TABLE WHERE CONDITION = 'whatever'
the only thing I get back is the output of COL_NAME(@table_id, @int) almost like it ignored the word "FROM" and everything behind it.
Is there any way I can select data by the column number and not by the column name??
My DB system is MS SQL Server 2000.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|