From the course: Querying Microsoft SQL Server 2022

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

The SQL querying environment

The SQL querying environment

- One of the most common database queries is to retrieve a number of records from a data table. In fact, this query is so common that the graphical interface here in Management Studio, provides this query as a menu item so that it can be executed without having to write any SQL code ourselves. Let's go into the Adventure Works Database and I'll expand the Tables folder, and here we have all the different data tables in this database. I'm going to find the one in the Human Resources schema called Department, then I'll right-click on it and choose Select Top 1000 Rows. This runs a query that asks the basic question, what data is in this table? Since, some data tables can be very large, the results on the bottom half of the screen will only display up to 1000 records that are stored in the table, if your table has that many. And these results are useful for getting a basic feel for the table's content. In this results…

Contents