{"id":3544,"date":"2009-06-29T00:06:21","date_gmt":"2009-06-29T00:06:21","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2009\/06\/29\/vs2010-beta1-web-application-project-database-package-and-smo-options\/"},"modified":"2009-06-29T00:06:21","modified_gmt":"2009-06-29T00:06:21","slug":"vs2010-beta1-web-application-project-database-package-and-smo-options","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/vs2010-beta1-web-application-project-database-package-and-smo-options\/","title":{"rendered":"VS2010 Beta1 Web Application Project Database package and SMO options"},"content":{"rendered":"<p>In Visual Studio 2010 Beta1 release, SQL server database schema and data can be packaged for deployment along with the website.&#160; It utilizes <a href=\"http:\/\/blogs.iis.net\/msdeploy\/archive\/2008\/11\/10\/the-msdeploy-sql-database-provider-dbfullsql.aspx\">Msdeploy SQL Database provider<\/a> functionality in IIS team\u2019s msdeploy release.&#160; <\/p>\n<p>In Visual studio 2010 Beta1, user can set the database package options in web application project\u2019s Deploy-SQL property page as following.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/image_2.png\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2009\/06\/image_thumb.png\" width=\"734\" height=\"436\" \/><\/a><\/p>\n<p>User can add a package connection by clicking \u201cAdd\u201d button and make sure it\u2019s checked.&#160; To select the source database for package, one can check \u201cPull data from an existing database\u201d check box, and select or enter the database connection string.&#160; In Beta1, only three packaging choices are provided for the database, \u201cSchema only\u201d, \u201cComplete database\u201d and \u201cExclude objects with no schema information from the generated script\u201d (SMO option SchemaQualify).&#160; <\/p>\n<p>User can also include their own SQL script file in the Database source Scripts list view as well.<\/p>\n<p><a href=\"http:\/\/blogs.iis.net\/msdeploy\/archive\/2008\/11\/10\/the-msdeploy-sql-database-provider-dbfullsql.aspx\">Msdeploy SQL Database provider<\/a> command line provides functionality to use many SMO options to package a database. In order to integrate this functionality to VS2010 Beta1, one can edit the project file directly.&#160; The following sample shows the project settings for the default schema only database.&#160; Note, the corresponding SMO options are set in PreSource tag of the corresponding connection list item.&#160; Advanced user can specify additional SMO option in the project file to script their databases.&#160; The additional SMO options will be preserved automatically even during property page operations. <\/p>\n<pre class=\"code\"><span style=\"color: blue\">&lt;<\/span><span style=\"color: #a31515\">PublishDatabaseSettings<\/span><span style=\"color: blue\">&gt;\n  &lt;<\/span><span style=\"color: #a31515\">Objects<\/span><span style=\"color: blue\">&gt;\n    &lt;<\/span><span style=\"color: #a31515\">ObjectGroup <\/span><span style=\"color: red\">Name<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">NewConnection1<\/span>&quot; <span style=\"color: red\">Order<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">1<\/span>&quot;<span style=\"color: blue\">&gt;\n      &lt;<\/span><span style=\"color: #a31515\">Destination <\/span><span style=\"color: red\">Path<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">Data Source=myServerName%3bInitial Catalog=myDeployDBName%3bIntegrated Security=True<\/span>&quot; <span style=\"color: blue\">\/&gt;\n      &lt;<\/span><span style=\"color: #a31515\">Object <\/span><span style=\"color: red\">Type<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">dbFullSql<\/span>&quot;<span style=\"color: blue\">&gt;\n        &lt;<\/span><span style=\"color: #a31515\">PreSource <\/span><span style=\"color: red\">Path<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">Data Source=myServerName%3bInitial Catalog=myDBName%3bIntegated Security=True<\/span>&quot;<br \/> <span style=\"color: red\">ScriptSchema<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">True<\/span>&quot; <span style=\"color: red\">ScriptData<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/span>&quot; <span style=\"color: red\">SchemaQualify<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">True<\/span>&quot; <span style=\"color: blue\">\/&gt;\n        &lt;<\/span><span style=\"color: #a31515\">Source <\/span><span style=\"color: red\">Path<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">objDebugAutoScriptsNewConnection1_SchemaOnly.sql<\/span>&quot; <span style=\"color: blue\">\/&gt;\n      &lt;\/<\/span><span style=\"color: #a31515\">Object<\/span><span style=\"color: blue\">&gt;\n    &lt;\/<\/span><span style=\"color: #a31515\">ObjectGroup<\/span><span style=\"color: blue\">&gt;\n  &lt;\/<\/span><span style=\"color: #a31515\">Objects<\/span><span style=\"color: blue\">&gt;\n&lt;\/<\/span><span style=\"color: #a31515\">PublishDatabaseSettings<\/span><span style=\"color: blue\">&gt;<\/span><\/pre>\n<p><a href=\"http:\/\/11011.net\/software\/vspaste\"><\/a><\/p>\n<p>In VS2010 Beta1, there are some known problems regarding the database packaging, including the following:<\/p>\n<p>1. transacted=false SMO option does not function as expected. (For certain database objects, such as full text catalog, full text index, user roles, transacted=false SMO option is required in order to be able to deploy successfully.)\n  <br \/>2. triggers using certain objects&#160; maybe scripted before the objects is defined.&#160; This is resolved with the <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=b33d2c78-1059-4ce2-b80d-2343c099bcb4&amp;displaylang=en\">April 2009\u2019s SQL server 2008 feature pack\u2019s management objects download<\/a>.<\/p>\n<p>3. SMO options supported is limited by <a href=\"http:\/\/blogs.iis.net\/msdeploy\/archive\/2008\/11\/10\/the-msdeploy-sql-database-provider-dbfullsql.aspx\">Msdeploy SQL Database provider<\/a>\u2018s capacity.&#160; Currently, it only support SMO option\u2019s Boolean values.<\/p>\n<p>In addition, we are still modifying the feature based on user\u2019s feedback.&#160; Please contact us with your advices.&#160; Thanks.<\/p>\n<p>Xinyang Qiu\n  <br \/>SDETII <\/p>\n<p>Visual Studio Web Tools<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Visual Studio 2010 Beta1 release, SQL server database schema and data can be packaged for deployment along with the website.&#160; It utilizes Msdeploy SQL Database provider functionality in IIS team\u2019s msdeploy release.&#160; In Visual studio 2010 Beta1, user can set the database package options in web application project\u2019s Deploy-SQL property page as following. User [&hellip;]<\/p>\n","protected":false},"author":404,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7341,7323,7329],"class_list":["post-3544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-database","tag-visual-studio-2010","tag-web-deployment"],"acf":[],"blog_post_summary":"<p>In Visual Studio 2010 Beta1 release, SQL server database schema and data can be packaged for deployment along with the website.&#160; It utilizes Msdeploy SQL Database provider functionality in IIS team\u2019s msdeploy release.&#160; In Visual studio 2010 Beta1, user can set the database package options in web application project\u2019s Deploy-SQL property page as following. User [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/404"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=3544"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=3544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=3544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=3544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}