'SQL Server 2012 how do I view data?

I have several tables in my database and I am using the SQL Server Management Studio for the first time. I want to see the data. In an SQLite 3 or MySQL

I'd simply type SELECT * FROM tblName WHERE...

the output would be in my console.



Solution 1:[1]

In SSMS open a new query window (Ctrl + n), make sure the database is selected from the databases dropdown (Ctrl + d to focus to the list, then up/down arrows and Enter to select the DB), write the query and F5 to run.

You can use the mouse for all of the above (there is a toolbar button for new query window, and you can use the mouse for selecting the DB).

An alternative is to use the object browser to drill down to the database and table in question, right click on the table name and select the "Select top 1000 rows..." (or similar) option.

Solution 2:[2]

In SSMS, hit the 'new query' button, which should be right under the "file edit view..." menu. You'll get a blank window where you can type the SQL, with the results showing up underneath.

You'll also get an extra toolbar to select the default table, unless you do a use yourdb; query as the first operation in the query window.

Solution 3:[3]

Couple of ideas:

With SSMS:

  1. Connect to server > database > tables > Right click and select top 1000.
  2. Click New Query and type SELECT * FROM TABLE
  3. Use osql or sqlcmd

Solution 4:[4]

To view data in SQL Server Studio

Run this command : select * from (your table name)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Oded
Solution 2 Marc B
Solution 3 Andrew Barber
Solution 4 Omendar Pal Singh