Difference between revisions of "Running scripts in SQL Server Management Studio"

From EHS Help
Jump to: navigation, search
(First draft)
 
m
Line 8: Line 8:
 
Instructions here are specifically for the IBID Training Centre in Wythenshawe, but the principles apply to any installation.
 
Instructions here are specifically for the IBID Training Centre in Wythenshawe, but the principles apply to any installation.
  
- Start remote desktop and login to UHSM-IBID2.
+
* Start remote desktop and login to UHSM-IBID2.
- Start MS SQL Server Management Studio
+
* Start MS SQL Server Management Studio
- Select File > Open > File from the menu  (or press CTRL + O) (or press the Open button on the toolbar)
+
* Select File > Open > File from the menu  (or press CTRL + O) (or press the Open button on the toolbar)
- In the Open File window, pick the .sql file and press Open
+
* In the Open File window, pick the .sql file and press Open
- On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
+
* On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
- Press Execute on the toolbar.
+
* Press Execute on the toolbar.
  
  
 
=== Running Scripts via copy & paste ===
 
=== Running Scripts via copy & paste ===
  
- Start remote desktop and login to UHSM-IBID2.
+
* Start remote desktop and login to UHSM-IBID2.
- Start MS SQL Server Management Studio
+
* Start MS SQL Server Management Studio
- Copy the SQL script to the clipboard from another program, e.g. the web - being careful to include all characters.
+
* Copy the SQL script to the clipboard from another program, e.g. the web - being careful to include all characters.
- Press the New Query button on the toolbar.
+
* Press the New Query button on the toolbar.
- Paste the SQL into the query window by pressing CTRL + V (or selecting Edit > Paste from the menu)
+
* Paste the SQL into the query window by pressing CTRL + V (or selecting Edit > Paste from the menu)
- On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
+
* On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
- Press Execute on the toolbar.
+
* Press Execute on the toolbar.

Revision as of 10:14, 20 April 2016

_NOTOC__

This is a Technical (IT) Instructions topic


Running Scripts from Files

Instructions here are specifically for the IBID Training Centre in Wythenshawe, but the principles apply to any installation.

  • Start remote desktop and login to UHSM-IBID2.
  • Start MS SQL Server Management Studio
  • Select File > Open > File from the menu (or press CTRL + O) (or press the Open button on the toolbar)
  • In the Open File window, pick the .sql file and press Open
  • On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
  • Press Execute on the toolbar.


Running Scripts via copy & paste

  • Start remote desktop and login to UHSM-IBID2.
  • Start MS SQL Server Management Studio
  • Copy the SQL script to the clipboard from another program, e.g. the web - being careful to include all characters.
  • Press the New Query button on the toolbar.
  • Paste the SQL into the query window by pressing CTRL + V (or selecting Edit > Paste from the menu)
  • On the Toolbar, ensure that the database drop down list is showing the name of the database you want the script to act upon.
  • Press Execute on the toolbar.