dbTalk Databases Forums  

Copy table column names from SSMS Object Browser to use in a query

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Copy table column names from SSMS Object Browser to use in a query in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
iano
 
Posts: n/a

Default Copy table column names from SSMS Object Browser to use in a query - 11-06-2007 , 12:17 PM






I thought I saw this done once before. So today I hunted around in
Books OnLine and did a Google search. So far I have found nothing
close. So if you know how to do it, please tell me or if cannot be
done, I'd appreciate know that too.

Thanks in advance,
IanO


Reply With Quote
  #2  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: Copy table column names from SSMS Object Browser to use in a query - 11-06-2007 , 04:28 PM






On Tue, 06 Nov 2007 18:17:05 -0000, iano wrote:

Quote:
I thought I saw this done once before. So today I hunted around in
Books OnLine and did a Google search. So far I have found nothing
close. So if you know how to do it, please tell me or if cannot be
done, I'd appreciate know that too.
Hi IanO,

Open Object Explorer with F8 (of you don't have it open yet), expand
"Databases", then the name of your DB, then "Tables", then the name of
your table. Now, drag the "Columns" map to the editor window and a list
of all columns will automagically appear.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis


Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Copy table column names from SSMS Object Browser to use in a query - 11-06-2007 , 04:29 PM



iano (IanONet (AT) gmail (DOT) com) writes:
Quote:
I thought I saw this done once before. So today I hunted around in
Books OnLine and did a Google search. So far I have found nothing
close. So if you know how to do it, please tell me or if cannot be
done, I'd appreciate know that too.
Find the table in Object Explorer and expand the note. Select Columns
and drag it to the place where you want it.

My own take on this is that I simply run a SELECT * with TOP 1 or
WHERE 1 = 0 in text mode. I copy and paste into window in Textpad
where I have a macro that replaces the multiple spaces with comma +
space. Sounds kludgy? Well, navigating in an explorer tree takes time too.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.