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
What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration
How to set the current database in ms sql server?
What do we need queues in sql service broker?
What are the types of dml?
What is the difference between a function and a trigger?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
What is BCNF? How is it better than 2NF & 3NF?
What is a with(nolock)?
What is the purpose of self join?
What are “lock” hints?
What is the difference between mysql and mysqli?
What are differences in between sql server 2012 and sql server 2016?
What is plan freezing?
role of sql sever 2005 in database rather than any other database
What keyword you will use to get schema appended to the result set of a ‘for xml’ query?