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 specific conditions database should meet, before you can bulk copy data into it using bcp?
Difference between aggregate functions of sql?
What is implicit cursors?
What is partition index in sql server?
What is the difference between DataRow.Delete() and DataRow.Remove()?
What is query processing?
What happens if you insert a duplicate key for the primary key column in ms sql server?
What are the types of indexing?
Define outer join?
Can primary key be a foreign key?
What do you understand by triggers and mention the different types of it?
what are the reporting service components in SSRS?
How to use user defined functions in expressions?
Why does sql studio use a single registered database repository? : sql server management studio
What factors you will consider calculating the storage requirement for that view?