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
Can the query output be sorted by multiple columns in ms sql server?
Explain about analysis services?
What is service broker?
What do you mean by tablesample?
How to use wildcard characters in like operations in ms sql server?
Can you explain powershell included in sql server 2008?
What is a matrix in ssrs?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
Do you know what is lock escalation?
Why I am getting this error when renaming a database in ms sql server?
Can we write a distributed query and get some data which is located on other server and oracle database?
there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration
What are translations and its use? : sql server analysis services, ssas
What is buffer cash and log cache in sql server?
Is a primary key unique?