MRRisley:=("Setting up T-SQL on your PC")

Note: This guide is adapted from Itzik Ben-Gan's T-SQL Fundamentals, 3rd edition.
Github Icon with Link
Back to SQL Home
Setting up T-SQL

Download MS SQL Express 2014 with Tools

  1. Follow link here.
  2. Select language.
  3. Click download.
  4. Check ExpressAndTools 64BIT\SQLEXPRWT_x64_ENU.exe and download.


Install

  1. Unless you have reason otherwise, select "New SQL Server stand-alone installation..." when prompted.
  2. Accept license terms when prompted.
  3. On Feature Selection window, ensure that you select LocalDB in addition to the default selections.
  4. Feature Selection Window
  5. On Instance Configuration window, ensure that you remember the named instance and Instance ID if you choose to change them. I recommend the default.
  6. Instance Configuration Window
  7. Unless you have reason otherwise, press Next on Server Configuration screen.


Setup Local Server Instance

  1. Open SQL Server Management Studio.
  2. Click Cancel when prompted.
  3. Go to View -> Registered Servers
  4. A Registered Servers window should open with a "Database Engine." Expand the Database Engine by pressing the + symbol.
  5. Right-click on Local Server Groups.
  6. Tasks -> Register Local Servers
  7. It should register one server, which will now display under Local Server Groups.
  8. When you exit Management Studio and re-open it, the local server should be the default connection.

Here's the MS website for setting this up.



Download AdventureWorks 2014
This is a sample database provided by MS.

  1. Follow link here.
  2. Under "To install AdventureWorks", click the link under number (2), "download AdventureWorks-oltp-install-script.zip".
  3. Create a folder Samples on your C:\ drive. Within the Samples folder, create a folder called AdventureWorks. Move or extract all files to from the download to this file (file path: C:\Samples\AdventureWorks\).
  4. Once connected to SSMS, open the file instawdb.sql within C:\Samples\AdventureWorks\
  5. Click the Query menu at top of the toolbar and select SQLCMD mode. This is the command mode for SQL.
  6. Select SQLCMD Mode
  7. Run the query by pressing F5 or pressing the execute button.
  8. Execute Button
  9. The code will execute with errors. This is because we do not have full-text search enabled.
  10. Ensure that you can see an AdventureWorks database and tables, shown below.
  11. AdventureWorks Database in Object Explorer

Debugging:



Download Accompanying Files for Ben-Gan
These are files to accompany T-SQL Fundamentals., 3rd ed. by Itzik Ben-Gan

  1. Follow link here.
  2. The zip file is a collection of scripts for each chapter. If running these scripts are required, the steps will be reviewed together with the concepts.
Github Icon with Link
Back to SQL Home