Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration

1078


How to set the current database in ms sql server?

1009


What do we need queues in sql service broker?

1003


What are the types of dml?

930


What is the difference between a function and a trigger?

1013


what is the Ticketing tool used in Wipro technologies at Bangalore...???

8109


What is BCNF? How is it better than 2NF & 3NF?

963


What is a with(nolock)?

925


What is the purpose of self join?

914


What are “lock” hints?

998


What is the difference between mysql and mysqli?

1083


What are differences in between sql server 2012 and sql server 2016?

978


What is plan freezing?

909


role of sql sever 2005 in database rather than any other database

1887


What keyword you will use to get schema appended to the result set of a ‘for xml’ query?

988