Wednesday, April 06, 2011

 

SSMS Table Column List Tip

On occasion, you will be at someone’s desk, looking over their shoulder when you suddenly notice something and exclaim “Hold on! How did you do that?” quickly followed by “I can’t believe I didn’t know about that!”.

I had just such an experience a few days ago. At the risk of being the last person to know this: in SQL Server Management Studio Object Explorer: open a Database, open the Tables folder, and open a Table. Left click on the Column list folder, and drag and drop to an open query window: you get a comma separated list of column names.

In the past, I had always right-clicked on the table, selected Script->Create To->New query window and then edited out the list of columns.  D’oh!



    

Powered by Blogger