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 transaction server consistency?

990


What is application role in sql server database security? : sql server security

1012


What is nonclustered index on computed columns?

917


What are the types of subquery?

997


Explain trigger and trigger types?

924


What are the differences between stored procedure and the dynamic sql?

1045


How to use "begin ... End" statement structures in ms sql server?

977


what is datawarehouse?

1072


Explain what you mean by 3 tier architecture.

1033


What is the difference between a local and a global temporary table?

1074


Explain use of expression builder.

973


How many types of subqueries are there in sql server?

951


How to use go command in "sqlcmd"?

1145


How to define and use table alias names in ms sql server?

1070


What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

1125