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?

Answers were Sorted based on User's Feedback



How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?..

Answer / k m rajesh

Declare @ColumnName Varchar(50)
Select @ColumnName = Name From syscolumns Where id = object_id(Table_Name) and ColID = (Select Count(name)-1 from SysColumns Where id = object_id(Table_Name))

Is This Answer Correct ?    0 Yes 0 No

How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?..

Answer / 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

More SQL Server Interview Questions

What is the difference between the application object and session object?

0 Answers  


What is the disadvantages of index?

3 Answers   TCS,


Explain cursor as data base object?

0 Answers  


What are sql dirty pages?

0 Answers  


What is policy based management (pbm)? : sql server database administration

0 Answers  


What is Index ? Explain its Types?

2 Answers   ADP,


Can you link only other SQL Servers or any database servers such as Oracle?

1 Answers  


can anyone explain me the concept of Serialization in Detail and Clear? plz its urgent i have interview on friday (15th feb)

1 Answers  


Where the sql logs gets stored? : sql server database administration

0 Answers  


If i am handling 150 servers then how to check the active jobs of all the servers?

0 Answers  


How to determine the service pack currently installed on SQL Server?

4 Answers   HCL,


How to find the second highest salary of an employee?

0 Answers  


Categories