How to view individual records?

  • As a newbie, I have a question which I hope isn’t too stupid:

    In SSMS, I know I can view information about a database via

    Object Explorer | Database Engine instance | database (right-click) | Properties

    But isn't there any way to view individual records in the database? Otherwise, how do I even know what data fields are in the individual records? Without knowing even that much, how can I even practice making queries?

  • Why wouldn't you just use SELECT TOP 100 * FROM dbo.yourtablename to see the individual rows of data?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Hi, Jeff Moden -

    Thanks for the tip; that's what I'll do.

    The reason I didn't think of that is because I know NOTHING about SQL yet. You have to start somewhere, right?

    By the way, I apologize for posting this thread here; I think I should have posted it in the "SQL Server Newbies" forum. If the moderators decide to move it there, I'll understand.

    Thanks again.

  • vxhughes (6/4/2013)


    Hi, Jeff Moden -

    Thanks for the tip; that's what I'll do.

    The reason I didn't think of that is because I know NOTHING about SQL yet. You have to start somewhere, right?

    By the way, I apologize for posting this thread here; I think I should have posted it in the "SQL Server Newbies" forum. If the moderators decide to move it there, I'll understand.

    Thanks again.

    Ah... got it. And, no... your post is just fine here.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Hi, Jeff Moden -

    OK, that's working, but I see a table "dbo.DimCustomer" in two different databases (AdventureWorksDW and AdventureWorksDW2008). How do I know which database the retrieved data is coming from?

  • As long as both databases are on the same instance, you can....

    1. USE <db>

    SELECT * FROM dbo.DimCustomer

    2. SELECT * FROM <db>.dbo.DimCustomer

    3. Choose the db from the db drop down in SSMS.

    Then run your select statement.

    Replace <db> with the db name.

    Mike

    How to Post Performance Problems[/url]

    How to Post Best Practices[/url]

Viewing 6 posts - 1 through 5 (of 5 total)

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