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 specific conditions database should meet, before you can bulk copy data into it using bcp?

931


Difference between aggregate functions of sql?

1037


What is implicit cursors?

996


What is partition index in sql server?

1044


What is the difference between DataRow.Delete() and DataRow.Remove()?

1163


What is query processing?

880


What happens if you insert a duplicate key for the primary key column in ms sql server?

928


What are the types of indexing?

1028


Define outer join?

927


Can primary key be a foreign key?

994


What do you understand by triggers and mention the different types of it?

879


what are the reporting service components in SSRS?

151


How to use user defined functions in expressions?

1005


Why does sql studio use a single registered database repository? : sql server management studio

948


What factors you will consider calculating the storage requirement for that view?

894