sql management objects sql server management studio plug in l.
Download
Skip this Video
Download Presentation
SQL Management Objects / SQL Server Management Studio Plug-In

Loading in 2 Seconds...

play fullscreen
1 / 7

SQL Management Objects / SQL Server Management Studio Plug-In - PowerPoint PPT Presentation


  • 306 Views
  • Uploaded on

SQL Management Objects / SQL Server Management Studio Plug-In. Mark Gilbert BlueGranite, Inc. The Task. Create a scripting plug-in for SSMS that creates DROP/CREATE scripts like SQL Server 2000 Enterprise Management: IF EXISTS … DROP … GO CREATE … GO. Scripting with SMO.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'SQL Management Objects / SQL Server Management Studio Plug-In' - sherlock_clovis


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
sql management objects sql server management studio plug in

SQL Management Objects / SQL Server Management Studio Plug-In

Mark Gilbert

BlueGranite, Inc.

the task
The Task

Create a scripting plug-in for SSMS that creates DROP/CREATE scripts like SQL Server 2000 Enterprise Management:

IF EXISTS … DROP …

GO

CREATE …

GO

scripting with smo
Scripting with SMO

SQL Management Objects (SMO) are used to create the DROP and CREATE statements.

See:

SSMSScriptor.GenerateScripts()

plugging in setup
Plugging In - Setup

Project Properties:

  • Application: Class Library
  • Compile: Register for COM Interop
  • Debug: Start External Program (SSMS)
  • References: See PlugIn.vb comments

Registry Key:

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Shell\AddIns\SSMSScriptor.Plugin

plugging in classes
Plugging In – Classes

PlugIn

The entry point for the plug-in

MenuNode:

Encapsulates all logic for adding an item to the context menus

ScripterMenuItem

Used when the user invokes a menu item

future enhancements
Future Enhancements
  • Allow the user to script individual user-defined functions.
  • Script the objects out in dependency-order
  • Make the scripter form itself more flexible
resources
Resources
  • SMO:
    • http://msdn2.microsoft.com/en-us/library/ms162169.aspx
  • Scripting with SMO:
    • http://msdn2.microsoft.com/en-us/library/ms162153.aspx
    • http://davidhayden.com/blog/dave/archive/2006/11/09/ScriptDatabaseUsingSQLServerManagementObjects.aspx
  • Enisey Data Scripter (inspiration)
    • http://www.codeproject.com/useritems/enisey.asp