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 unique key constraint?
What does truncate do?
What is the difference between for xml raw and for xml auto?
Tell me what is de-normalization and what are some of the examples of it?
Define cursor locking
When to use null data driven subscription?
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
How do I edit a procedure in sql server?
Explain what is public role in sql server?
What is sql server english query?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
What is row-level compre?
Can you force a query to use a specific index?
What is the process of normalising?
How can i Relate Tables in SSIS