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

Note: This guide is adapted from Itzik Ben-Gan's T-SQL Fundamentals, 3rd edition.
Github Icon with Link
Back to SQL Home
Note: You always have to follow these steps every time you log in to a UC PC, whether physical or virtual. (You don't have to re-download AdventureWorks, however, if saved to your I:/ drive.)

Setting up T-SQL

Open SQL Server Management Studio (SSMS) through UC computer.


Connect to LocalDB

  1. After starting SSMS, ensure Server type is set to "Database Engine."
  2. Type (LocalDB)\MSSQLLOCALDB in the Server name field.
  3. Windows Authentication should be set as default and your user name / password should be grayed out. No change is necessary.
  4. LocalDB Connection


Download AdventureWorks 2014 to your Personal Drive
This is a sample database provided by MS.

  1. On UC computer, follow link here.
  2. Under "To install AdventureWorks", click the link under number (2), "download AdventureWorks-oltp-install-script.zip".
  3. Move or extract all files from Downloads folder to I:/Documents/AdventureWorks/ . You'll have to create the AdventureWorks folder.
  4. Extract AdventureWorks
  5. Once connected to SSMS, open the file instawdb.sql within I:/Documents/AdventureWorks/
  6. Click the Query menu at top of the toolbar and select SQLCMD mode. This is the command mode for SQL.
  7. Select SQLCMD Mode
  8. Navigate to the first line that is not colored green in the script. The code should read:
  9. 
     :setvar SqlSamplesSourceDataPath "C:\Samples\AdventureWorks\"			 
    			 

    Change it to:

    
     :setvar SqlSamplesSourceDataPath "I:\Documents\AdventureWorks\"			 
    			 
  10. Run the query by pressing F5 or pressing the execute button.
  11. Execute Button
  12. The code will execute with errors. This is because we do not have full-text search enabled.
  13. Ensure that you can see an AdventureWorks database and tables, shown below.
  14. AdventureWorks Database in Object Explorer

Debugging:

Refresh Server Instance


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