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

From EHS Help
Jump to: navigation, search
(First draft)
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
_NOTOC__
+
__NOTOC__
  
 
{{ProductTopic|Technical (IT)|Instructions}}
 
{{ProductTopic|Technical (IT)|Instructions}}
  
 +
 +
Instructions here are specifically for the IBID Training Centre in Wythenshawe, but the principles apply to any installation.
  
 
=== Running Scripts from Files ===
 
=== Running Scripts from Files ===
  
Instructions here are specifically for the IBID Training Centre in Wythenshawe, but the principles apply to any installation.
+
Use these instructions if you have an .SQL file.
  
- 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.
+
Use these instructions if the SQL you need is on a web-page or in another application.
- 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.
+
* Start remote desktop and login to UHSM-IBID2.
- Press the New Query button on the toolbar.
+
* Start MS SQL Server Management Studio
- Paste the SQL into the query window by pressing CTRL + V (or selecting Edit > Paste from the menu)
+
* Copy the SQL script to the clipboard from another program, e.g. the web - being careful to include all characters.
- 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 the New Query button on the toolbar.
- Press Execute 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.

Latest revision as of 10:16, 20 April 2016


This is a Technical (IT) Instructions topic


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

Running Scripts from Files

Use these instructions if you have an .SQL file.

  • 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

Use these instructions if the SQL you need is on a web-page or in another application.

  • 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.