How to display n-1 columns from n number of columns, from a
single table in MS SQL server 2005?
Answer Posted / rajesh ranjan
Declare @ColumnName varchar(50)
select @ColumnName=Name from syscolumns where id=object_id
(Table_Name) and colid=1 --2 for second Column, 3 for third
exec ('select '+@ColumnName+' from Table_Name')
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How do you rebuild an identity column?
What is forward - only cursors / read only cursor?
What is parameterized reports in ssrs ?
Explain the benefits of user-defined functions?
How to drop an existing table with "drop table" statements in ms sql server?
What is clustered index
Sql server reporting services vs. Crystal reports.
do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
How you trouble shoot when any job fails
i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.
How to list all field names in the result set using mssql_field_name()?
What is trigger and different types of Triggers?
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
Do you know what is user defined datatypes and when you should go for them?
What are the benefits and tasks of object explorer? : sql server management studio