saadan saadan - 2 years ago 108
SQL Question

SQL Server 2008 column select

In SQL Server, if I got a table with like 20 columns and I want 18 of them, can I say something like

* minus columnname1, columnname2,
course right now I write them all.

But if you could it would be much easier.

Answer Source

It is not possible. However if you are using SQL Server Management Studio 2008 / 2005 you can right click on the table and select the "Script Table as > SELECT To" menu option. This will save you typing the column names, or purchase Red-Gate's SQL Prompt

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download