How To Completely Uninstall/Remove All Versions of SQL Server and related tools/docs

  1. Download get-installedapp.ps1
  2. Load PowerShell ISE and execute the following:
    .\get-installedapp -appname "*SQL*SERVER*" -matchall |  select-object -expandproperty AppID |   foreach-object { "msiexec /x ""$_""" } > uninstall.bat
  3. Run the generated uninstall.bat


To see what applications the above command would remove, run this first:

.\get-installedapp -appname "*SQL*SERVER*" -matchall  | select-object AppName,AppID


How To Copy Schema And Data From One SQL Server Instance To Another

Within Microsoft SQL Server Management Studio 2008:

  1. Right click the database
  2. Select Tasks -> Generate Scripts
  3. (Click next if you get the intro screen)
  4. Select “Select specific database objects”
  5. Pick the objects to generate scripts for (tables, stored procedures, etc…)
  6. Click Next, then specify the output filename
  7. Click Finish to generate the script

This will generate the schemas only. If you want to do data generating scripts as well, in step 6) click the Advanced button and scroll down to the “Types of data to script” and change it from “Schema only” to “Data only” or “Schema and data”

How To Install SQL Server Management Studio 2008 R2 Express

1) Download Here (If link is dead search for “SQL Server 2008 R2 Management Studio Express”

2) Follow these instructions

Note: R2 install is a little different as you don’t have to select the SQL Server Express instance, but very similar. Also, Install Visual Studio 2010 first as it comes bundled with SQL Server 2008 Express.

If you need to debug SQL statements through say a SqlCommand or Entity framework you’ll want to install the full SQL Server Management Studio (Developer edition) and be sure to choose the “Complete” option under “Management Tools”

How to import/export SQL tables, functions and stored procs with SQL Management Studio 2005

  • In Microsoft SQL Server Management Studio Express, expand the databases.
  • Right-Click on the database containing objects you want to copy to another database
  • Click on Tasks, then Generate Scripts… This will open up the Script Wizard, which is pretty much self-explanatory:
    • Select the database (which should be pre-selected for you),
    • Select Options (first time around you might just accept the default selections),
    • Choose the Object Types you want to script (Stored Procedures, User Defined Functions, etc),
    • Select the specific objects to be scripted,
    • and finally specify where to output the script (choose Script to new Query Window for convenience).
  • Once completed, return to the Query Window with the scripted objects.  Change the USE directive (the first line) to point to the destination database (e.g., USE [Northwind]), and execute the script.