• mister magoo i have a kinda-sorta solution i use for that issue; instead of a drag and drop, i have a keyboard shortcut in SSMS that i call on any highlighted text (so it assumes a table)

    i created this simple proc and mark it as a system proc in master:

    CREATE PROCEDURE sp_colz @Tablename sysname

    AS

    SELECT DISTINCT

    t.name,

    sq.Columns

    FROM sys.tables t

    JOIN (

    SELECT OBJECT_ID,

    Columns = STUFF((SELECT ',' + quotename(name)

    FROM sys.columns sc

    WHERE sc.object_id = s.object_id

    FOR XML PATH('')),1,1,'')

    FROM sys.columns s

    ) sq ON t.object_id = sq.object_id

    WHERE t.name =@Tablename

    GO

    --mark it as a system object so it functions against the currently-scoped-databases sys.tables/sys.columns

    EXECUTE sp_ms_marksystemobject 'sp_colz'

    then i add a keyboard shortcut:

    from there, if i was typing a query, and needed the column names, i highlight the tablename, hit control+8(in my case)

    and i get the results below for a fast copy/paste.

    you can see I have similar shortcuts for lots of other functions, and in total they all make me immensely more productive for things commonly looked up things like this.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!