Click here to Skip to main content
Licence GPL3
First Posted 1 Jul 2008
Views 10,942
Downloads 54
Bookmarked 16 times

Script Running Wizard Add-In for SQL Server Management Studio

By | 18 Jul 2008 | Article
A wizard that will run specified scripts in a SSMS project

Introduction

Microsoft's SQL Server Management Studio allows you to have a project to organize scripts and also lets you add "External Tools" that can interact with your projects. The downside is: when a large amount of scripts from a project need to be executed, they must be opened and executed one by one. I found an article that executed all of the scripts in the project that works great when all of the scripts need to be executed, but I needed a tool that could execute the scripts in a specified order.

How the Code Works

The Management Studio calls the program with “$(ProjectDir),$(ProjectFileName)” arguments passed in, and the wizard finds the project, which is stored with XML, and reads the files. The wizard will set some options up for the execution, then execute the files asynchronously, allowing users to stop execution.

Installing External Tools

To install:

  1. Go to Tools (on the main menu) -> External Tools...
  2. Add a new tool by clicking Add
  3. Give the tool a title. for the command, locate the ExecuteAll.exe
  4. Arguments must be $(ProjectDir),$(ProjectFileName)
  5. Leave the Initial Directory blank

Note: The check-boxes do not affect the way the program runs.

ExecuteAll

Conclusion

This wizard makes projects more useful and easier to execute. Feel free to modify the source code. To see a simpler example of a Microsoft SQL Server Management Studio, please visit this article. For more information about using this program, there is documentation in the download file.

History

  • 7/18/2008 - Fixed an error with separating batches by "GO"

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

Scott Clewell



United States United States

Member

Scott is attending Washburn University studying in Computer Science. He works as a DBA with CommunityAmerica Credit Union and develops [Windows] applications independently.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 18 Jul 2008
Article Copyright 2008 by Scott Clewell
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid