How to Run a Patch Script

1. On the server where SQL 2008 or your SQL Sever is installed, navigate to the SQL Server Management Studio. This is usually found in the Start menu or by clicking on Start/All Programs/Microsoft SQL Server 2008/SQL Server Management Studio. 

 

2. You will then see a Connect to Server box open. If the Authentication is set to Windows Authentication and you are logged on as a user with admin-level rights, click the Connect button. If the authentication is set to SQL Server Authentication, you will need to log in as sa for the username, the password for sa account, and click the Connect button. 


3. In the upper left corner of the Microsoft SQL Server Management Studio screen, you will see a button called New Query. Click on that and it will open a SQL Query window on the right side of the screen. 

4. In the upper left corner, there will be a drop-down to select the correct database name to run this script against. Please be sure you select the right database. The query window on the right should show the servername.database name in the header tab. 

5. If you have the SQL query text, you can copy and paste it into this blank window. Otherwise, if you have the file on the server locally, you can select the Open file icon located in the toolbar at the top of the screen. Then, browse to the location of the .sql file, highlight it, and click the Open button. This will give you the Connect to Database Engine box again and you can log in the same way you did in step 2. If you imported the query this way, you will need to reselect the database from the dropdown at the top again as in step 4. 

6. Making sure nothing in the query window on the right is specifically highlighted and the correct database name is showing in the dropdown at the top, click the Execute button in the toolbar at the top of the screen. You can also execute the query by selecting the F5 key on your keyboard. 

7. The script will run and show you how many rows were updated in the messages tab if applicable as well as show you at the bottom that the query executed successfully.

8. Repeat this process for additional SQL scripts or additional databases. 

Was this answer helpful? 0 Users Found This Useful (0 Votes)