I'm loading a sql script up to an SSMS 2008 add-in like so:
' create a new blank document
ServiceCache.ScriptFactory.CreateNewBlankScript(Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptType.Sql)
' insert SQL statement to the blank document
Dim doc As EnvDTE.TextDocument = CType(ServiceCache.ExtensibilityModel.Application.ActiveDocument.Object(Nothing), EnvDTE.TextDocument)
doc.EndPoint.CreateEditPoint().Insert(_Output.ToString())
Is there a way to automatically execute the statement as well?
Thanks,
Mark