To do so let’s type, “SELECT Name, GroupName FROM HumanResources.Department”. For example, let’s just return the Name and GroupName. It’s best practice to return only the columns you need. We can do this by typing out in the new query window, “SELECT * FROM HumanResources.Department”.
Let’s start by just returning all rows and all columns from with HumanResources.Department. Right click on AdventureWorks2008RS and select, “New Query”. We can assume that this table models departments and divisions inside of the AdventureWorks organization. At that point, just type in “Constraints”, and you’ll find an entry constraints in the section on understanding tables. You may find the BOL entry by clicking, “Help” inside of SSMS and clicking, “search”. Constraints are quite important in databases, you can learn about them more here as well as in Books Online (BOL), the help built into SQL Server Management Studio (SSMS). In addition, we have a default constraint on the ModifiedDate column. In the above picture, we can observe that we have four columns titled, “DepartmentID”, “Name”, “GroupName”, and, “ModifiedDate”. The two features you’re likely to be most interested to start with are columns and constraints. If you expand a table, say HumanResources.Department, you find features that are appropriate to tables contained within.
I have to assume some basic level of acquaintance with databases, but succinctly put, tables are to databases what tracks are to CDs (I wonder how long that analogy will last). You’ll see a number of tables within the database.
#ADVENTUREWORKS DATABASE 2017 PLUS#
Click the plus sign next to AdventureWorks2008R2. Let’s take a moment to explore our surroundings a little bit. Upon successful install, we were able to connect to our database server and expand the installed databases. In a previous post, we walked through installing SQL Server 2008 and the Adventure Works databases.