1 / 7

SQL Management Objects / SQL Server Management Studio Plug-In

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.

Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL Management Objects / SQL Server Management Studio Plug-In Mark Gilbert BlueGranite, Inc.

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

  3. Scripting with SMO SQL Management Objects (SMO) are used to create the DROP and CREATE statements. See: SSMSScriptor.GenerateScripts()

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

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

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

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

More Related