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

Describe how to use linked server?

1074


Where do we use trace frag?

1059


Explain the stored procedure?

1094


How do I find the sql server version?

1073


List out the difference between union and union all in sql server?

1036


What are the advantages of having an index on the sql server?

973


How do I find the size of a sql server database?

978


How to declare and use cursor variables?

1248


What is trace flag in sql server?

1078


How to round a numeric value to a specific precision?

1123


What are the types of normalization?

1072


Differentiate between delete and truncate.

1107


What are the advantages of user-defined functions over stored procedures in sql server?

1112


Which command is used for user defined error messages?

1103


Tell me what is log shipping?

1029