SQL exclude a column using SELECT * [except columnA] FROM tableA?

后端 未结 30 2516
花落未央
花落未央 2020-11-21 23:15

We all know that to select all columns from a table, we can use

SELECT * FROM tableA

Is there a way to exclude column(s) from a table witho

30条回答
  •  鱼传尺愫
    2020-11-21 23:43

    I know this is a little old, but I had just run into the same issue and was looking for an answer. Then I had a senior developer show me a very simple trick.

    If you are using the management studio query editor, expand the database, then expand the table that you are selecting from so that you can see the columns folder.

    In your select statement, just highlight the referenced columns folder above and drag and drop it into the query window. It will paste all of the columns of the table, then just simply remove the identity column from the list of columns...

提交回复
热议问题