none
Select All column except one in SQL

    Question

  • Hi,

    I have a table with 100 column i want to select 99 column except one without writting name of all the 99 columns in the select statement.

     

    Monday, April 17, 2006 4:52 AM

Answers

  • TSQL has nothing to provide this. Anyway, you may just drag'n'drop Colunms folder (one that within a table in Object Browser, of course) to your query window, and then just to delete column you don't want to include in the query. This is common to both Query Analyzer and SSMS.
    Monday, April 17, 2006 6:17 AM
  • Hi Prashant,

    I guess SSMS is the Sql Server Management Studio. This is the replaced Enterprise Manager of SQL Server 2000 for SQL2005.

    You can have a similar solution in SQL 2005 by using SSMS. Just go to table you want to list its columns. Open context menu, select "Script Table as", "Select To" and "New Query Editor Window"

    You will all column listed in the query editor window and you can remove the unwanted columns from this list.

    Eralper

    http://www.kodyaz.com

     

    Monday, April 17, 2006 7:33 AM

All replies

  • TSQL has nothing to provide this. Anyway, you may just drag'n'drop Colunms folder (one that within a table in Object Browser, of course) to your query window, and then just to delete column you don't want to include in the query. This is common to both Query Analyzer and SSMS.
    Monday, April 17, 2006 6:17 AM
  •  

    This is good option and is helpfull for me. But can I do the same in SQL 2005 as i mentioned in my problem.

    And one thing you have writed about SSMS in your answer whts that.

    and Thanks for this.

    Monday, April 17, 2006 6:55 AM
  • Hi Prashant,

    I guess SSMS is the Sql Server Management Studio. This is the replaced Enterprise Manager of SQL Server 2000 for SQL2005.

    You can have a similar solution in SQL 2005 by using SSMS. Just go to table you want to list its columns. Open context menu, select "Script Table as", "Select To" and "New Query Editor Window"

    You will all column listed in the query editor window and you can remove the unwanted columns from this list.

    Eralper

    http://www.kodyaz.com

     

    Monday, April 17, 2006 7:33 AM