{"id":3394,"date":"2009-10-23T14:09:36","date_gmt":"2009-10-23T14:09:36","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2009\/10\/23\/dev10-beta2-import-from-web-config-file-and-other-changes-for-db-deployment-ui\/"},"modified":"2009-10-23T14:09:36","modified_gmt":"2009-10-23T14:09:36","slug":"dev10-beta2-import-from-web-config-file-and-other-changes-for-db-deployment-ui","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/dev10-beta2-import-from-web-config-file-and-other-changes-for-db-deployment-ui\/","title":{"rendered":"Dev10 Beta2, Import from web.config file and other changes for DB deployment UI"},"content":{"rendered":"<p>Dev10 Beta2 DB Deployment property page has some changes from Beta1.&#160; Please provide your valuable feedback for us to make it better for you.&#160; Thanks.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/image_2.png\"><img decoding=\"async\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2009\/10\/image_thumb.png\" width=\"657\" height=\"685\" \/><\/a> <\/p>\n<p>1. Tab page name changed from \u201cDeploy\/SQL\u201d To \u201cDeploy SQL\u201d<\/p>\n<p>2. Customer can use \u201cImport from Web.config\u201d button to import all the connection strings defined in root web.config to the database entries list.&#160; For example, if web.config contains the following connection strings:<\/p>\n<pre class=\"code\">  <span style=\"color: blue\">&lt;<\/span><span style=\"color: #a31515\">connectionStrings<\/span><span style=\"color: blue\">&gt;\n    &lt;<\/span><span style=\"color: #a31515\">add <\/span><span style=\"color: red\">name<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">ApplicationServices<\/span>&quot;\n         <span style=\"color: red\">connectionString<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true<\/span>&quot;\n         <span style=\"color: red\">providerName<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">System.Data.SqlClient<\/span>&quot; <span style=\"color: blue\">\/&gt;\n    &lt;<\/span><span style=\"color: #a31515\">add <\/span><span style=\"color: red\">name<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">AdventureWorksConnection<\/span>&quot;\n         <span style=\"color: red\">connectionString<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">Data Source=1p18-fwg36;Initial Catalog=AdventureWorks;Integrated Security=True<\/span>&quot;\n         <span style=\"color: red\">providerName<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">System.Data.SqlClient<\/span>&quot; <span style=\"color: blue\">\/&gt;\n  &lt;\/<\/span><span style=\"color: #a31515\">connectionStrings<\/span><span style=\"color: blue\">&gt;\n<\/span><\/pre>\n<p><a href=\"http:\/\/11011.net\/software\/vspaste\"><\/a><\/p>\n<p>Clicking \u201cImport from Web.config\u201d button, you will get two connection names in the database entries list.&#160; Each entry corresponds to a connection string in the web.config, with the connectionString content as the \u201cconnection string for the source database\u201d.&#160; <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/image_4.png\"><img decoding=\"async\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2009\/10\/image_thumb_1.png\" width=\"592\" height=\"369\" \/><\/a> <\/p>\n<p>&#160;<\/p>\n<p>3. Database scripting options is changed to a combo box with 3 choices: \u201cSchema Only\u201d, \u201cSchema And Data\u201d and \u201cData Only\u201d&#160; (Beta2 only has schema only and complete database choices).&#160; \u201cExclude objects with no schema information from the generated script\u201d option is removed form UI.&#160; (This SMO setting is called <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.sqlserver.management.smo.scriptingoptions.schemaqualify.aspx\">SchemaQualify<\/a>, default is false, you can set to true for each connection in project file if that is what desired.<\/p>\n<p>4. As Beta1, we hide complex scripting SMO options in the project file.&#160; If you view the project file of this web application, you will see the following:<\/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\">ApplicationServices<\/span>&quot; <span style=\"color: red\">Order<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">1<\/span>&quot; <span style=\"color: red\">Enabled<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/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;&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=.SQLEXPRESS%3bIntegrated Security=SSPI%3bAttachDBFilename=|DataDirectory|aspnetdb.mdf%3bUser Instance=true<\/span>&quot; <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\">CopyAllFullTextCatalogs<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/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\">objDebugAutoScriptsApplicationServices_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\">ObjectGroup <\/span><span style=\"color: red\">Name<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">AdventureWorksConnection<\/span>&quot; <span style=\"color: red\">Order<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">2<\/span>&quot; <span style=\"color: red\">Enabled<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/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;&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=1p18-fwg36%3bInitial Catalog=AdventureWorks%3bIntegrated Security=True<\/span>&quot; <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\">CopyAllFullTextCatalogs<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/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\">objDebugAutoScriptsAdventureWorksConnection_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;\n<\/span><\/pre>\n<p>&#160;&#160;&#160; We have CopyAllFullTextCatalogs=\u201dFalse\u201d defined as default to avoid script full text catalog creation SQL script into the script file.&#160; If&#160; it is specified as true or not defined, SQL database with full text catalog will generate a statement which is not transact-able during deploy: <\/p>\n<blockquote>\n<p>CREATE FULLTEXT CATALOG [test1234]\n    <br \/>WITH ACCENT_SENSITIVITY = ON<\/p>\n<p>AUTHORIZATION [dbo]<\/p>\n<\/blockquote>\n<p>5. Some SQL files are meant to be deployed without transaction, such as statement with \u201cCreate Database\u201d, \u201cCreate FULLTEXT CATALOG\u201d etc.&#160; In this case, we need to make sure msdeploy package them with setting <em><strong>Transacted=\u201dFalse\u201d<\/strong><\/em> in their <strong><em>Source <\/em><\/strong>XML tag in the project file.&#160; Such as following:<\/p>\n<pre class=\"code\">        <span style=\"color: blue\">&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\">3<\/span>&quot; <span style=\"color: red\">xmlns<\/span><span style=\"color: blue\">=<\/span>&quot;&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;&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=1p18-fwg35%3bInitial Catalog=test1%3bIntegrated Security=True<\/span>&quot; <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\">CopyAllFullTextCatalogs<\/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: red\">Transacted<\/span><span style=\"color: blue\">=<\/span>&quot;<span style=\"color: blue\">False<\/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<\/span><\/pre>\n<p><a href=\"http:\/\/11011.net\/software\/vspaste\"><\/a><a href=\"http:\/\/11011.net\/software\/vspaste\"><\/a><\/p>\n<p>Note, <strong><em>Source <\/em><\/strong>tag is used for this SMO option, not <strong><em>Presource<\/em><\/strong> tag, since this SMO option will be used in the source manifest file during packaging the generated script to the package file time.&#160; Our process is first use <strong><em>Presource <\/em><\/strong>SMO options to script a database to a temporary SQL file, then use <strong><em>Source<\/em><\/strong>&#160; SMO options in a manifest file to package the temporary SQL file to the web application package.&#160; Similar SMO options include \u201cdropDestinationDatabase\u201d.&#160;&#160; <\/p>\n<\/p>\n<p>Thanks<\/p>\n<p>Xinyang Qiu \n  <br \/>SDETII <\/p>\n<p>Visual Studio Web Tools<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dev10 Beta2 DB Deployment property page has some changes from Beta1.&#160; Please provide your valuable feedback for us to make it better for you.&#160; Thanks. 1. Tab page name changed from \u201cDeploy\/SQL\u201d To \u201cDeploy SQL\u201d 2. Customer can use \u201cImport from Web.config\u201d button to import all the connection strings defined in root web.config to the [&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,7336,7323],"class_list":["post-3394","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-database","tag-msdeploy","tag-visual-studio-2010"],"acf":[],"blog_post_summary":"<p>Dev10 Beta2 DB Deployment property page has some changes from Beta1.&#160; Please provide your valuable feedback for us to make it better for you.&#160; Thanks. 1. Tab page name changed from \u201cDeploy\/SQL\u201d To \u201cDeploy SQL\u201d 2. Customer can use \u201cImport from Web.config\u201d button to import all the connection strings defined in root web.config to the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3394","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=3394"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3394\/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=3394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=3394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=3394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}