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

How do you rebuild an identity column?

949


What is forward - only cursors / read only cursor?

1091


What is parameterized reports in ssrs ?

149


Explain the benefits of user-defined functions?

1063


How to drop an existing table with "drop table" statements in ms sql server?

1086


What is clustered index

1011


Sql server reporting services vs. Crystal reports.

132


do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration

990


How you trouble shoot when any job fails

1937


i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1903


How to list all field names in the result set using mssql_field_name()?

914


What is trigger and different types of Triggers?

1149


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

947


Do you know what is user defined datatypes and when you should go for them?

968


What are the benefits and tasks of object explorer? : sql server management studio

1182