What was that field name?

  • Does this not work on SQL Management Studio Express, or something? Can't get it to work on the SQL 2008 Express installation I have here...

  • I use dbForge SQL Complete Free version[/url]

    which shows column name and their data type in intellisense.

  • Thanks for this - I learnt something new today, albeit with the limitation that it will vanish when you start typing.

  • I knew about this feature, but didn't use it much because it required moving my hand from the keyboard. I didn't know about Alt-F1, so I learned something new from the comments. 🙂 Thanks for the question and for the comment.

  • Another subjective QOTD...

    I appreciate the exercise of learning about a feature that I didn't know - but as others have already said, "it depends".

  • Nifty, thanks Dave!

    I can't believe I've never noticed that.

    The Alt-F1 method is neat, but only seems to work for tables in your current 'default' database.

    Like Sebastian Zeller, I almost always alias my tables so typing the alias and '.' usually gives me a list of columns.

  • peter.row (8/6/2014)


    In typical SQL style actually the answer is "it depends" - on how you work.

    Hovering the mouse may be quick but not that helpful since as soon as you start typing the list tooltip disappears so if you want more than one from a table with quite a few fields and you really can't remember then that blows that out the water.

    +1

    Not only that, but in 2012 it's not a reliable method - I find it works for some tables and not for others (and I haven't a clue why).

    I have widescreen monitors (doesn't everyone nowadays?) at 1920 odd res so I have object explorer permanently pinned open. Further when I am working with a particular database (I'm a software dev) I expand Management Studio and typically have either tables or the programmability sections (or both) expanded so for me at wors it is a little bit of a scroll and a couple of clicks to get all the required information (including precision as someone else mentioned).

    Even on my laptop I generally have Object Manager pinned open (and that screen is only 1600 wide). But I also have an SP that that takes a table name and delivers a comma separated list of column names to save me typing (I wrote my first version of that when I decided it would be useful about 15 years ago). If I just want a reminder of a single column name OM is quick enough and reliable and gives complete type information, but if I want put many column names into for example a select list using an SP to generate a complete list (which I can then prune) is faster than anything else.

    Tom

  • TomThomson (8/6/2014)


    peter.row (8/6/2014)


    In typical SQL style actually the answer is "it depends" - on how you work.

    Hovering the mouse may be quick but not that helpful since as soon as you start typing the list tooltip disappears so if you want more than one from a table with quite a few fields and you really can't remember then that blows that out the water.

    +1

    Not only that, but in 2012 it's not a reliable method - I find it works for some tables and not for others (and I haven't a clue why).

    I have widescreen monitors (doesn't everyone nowadays?) at 1920 odd res so I have object explorer permanently pinned open. Further when I am working with a particular database (I'm a software dev) I expand Management Studio and typically have either tables or the programmability sections (or both) expanded so for me at wors it is a little bit of a scroll and a couple of clicks to get all the required information (including precision as someone else mentioned).

    Even on my laptop I generally have Object Manager pinned open (and that screen is only 1600 wide). But I also have an SP that that takes a table name and delivers a comma separated list of column names to save me typing (I wrote my first version of that when I decided it would be useful about 15 years ago). If I just want a reminder of a single column name OM is quick enough and reliable and gives complete type information, but if I want put many column names into for example a select list using an SP to generate a complete list (which I can then prune) is faster than anything else.

    I have a similar script with a bunch of params to specify whether I want a list in a SP param style (e.g. @FieldName DataType) or if I want it as a list of update set values (e.g. FieldName = @FieldName) combined with an alias (e.g. A.FieldName) and ordering too.

  • TomThomson (8/6/2014)if I want put many column names into for example a select list using an SP to generate a complete list (which I can then prune) is faster than anything else.

    I drag and drop the Columns node from the object browser when I want to do this

  • Toreador (8/6/2014)


    TomThomson (8/6/2014)if I want put many column names into for example a select list using an SP to generate a complete list (which I can then prune) is faster than anything else.

    I drag and drop the Columns node from the object browser when I want to do this

    Learned something new from the QotD, but THIS is really useful. Thanks!

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • thanks for this one, saves me from using sp_help tablename. The previously fastest way I knew.

  • I learned something new and useful. Thanks!

  • pmadhavapeddi22 (8/6/2014)


    Hany Helmy (8/6/2014)


    Easy, another fast way (but maybe not the fastest), just highlight the table then press Alt + F1 will give you all table structure, definition, columns names, data types, Identity fields (if any) and lot more.

    My ususal practice is alt + F1 (I though this option will be there in the list of answers but no ;-))

    +1, I also do this.. Not because this is faster or slower, but then I can actually COPY the column names and look at the available indexes 🙂

  • "Nice question. I use SQLPrompt by Redgate so I immediately get all the column names and data types through the IntelliSense without even doing anything..."

    Ditto! I now forget what it was like not having it. 😀

  • Sebastian Zeller (8/6/2014)


    You could also use a simple table alias to choose from the list of columns 🙂

    Select *

    FROM dbo.Customers c

    WHERE c.

    +1

    This is my preferred method, because it cuts out the garbage from Intellisense.

Viewing 15 posts - 16 through 30 (of 53 total)

You must be logged in to reply to this topic. Login to reply