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

Sql management objects sql server management studio plug in l.jpg
Download
1 / 7

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.

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

Download Presentation

SQL Management Objects / SQL Server Management Studio Plug-In

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 l.jpg

SQL Management Objects / SQL Server Management Studio Plug-In

Mark Gilbert

BlueGranite, Inc.


The task l.jpg

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 l.jpg

Scripting with SMO

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

See:

SSMSScriptor.GenerateScripts()


Plugging in setup l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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


  • Login