I also verified that this option is unchecked in the advanced options of the publish dialog before publishing. When I attempt to publish, I get the error: SQL Execution error:.Net SqlClient Data Provider: Msg 50000, Level 16, State 127, Line 6 Rows were detected. The schema update is terminating because data loss might occur. Turn your data into compelling stories of data visualization art. Quickly build interactive reports and dashboards with Data Studio’s web based reporting tools. Create your own report Explore visualizations you can use.
-->SQL Server Data Tools (SSDT) SQL Projects offer excellent functionality to relieve developers of the mundane, manual tasks involved with maintaining databases. If your company licenses Visual Studio 2010 or 2012 Professional or greater, you have the ability to create Visual Studio SSDT SQL Projects. Import the publish settings in Visual Studio and deploy. On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click Create new profile.
You can use the Publish tool to import publish settings and then deploy your app. In this article, we use publish settings for Azure App Service, but you can use similar steps to import publish settings from IIS. In some scenarios, use of a publish settings profile can be faster than manually configuring deployment to the service for each installation of Visual Studio.
These steps apply to ASP.NET, ASP.NET Core, and .NET Core apps in Visual Studio. You can also import publish settings for Python apps.
In this tutorial, you will:
- Generate a publish settings file from Azure App Service
- Import the publish settings file into Visual Studio
- Deploy the app to Azure App Service
A publish settings file (*.publishsettings) is different than a publishing profile (*.pubxml) created in Visual Studio. A publish settings file is created by Azure App Service, and then it can be imported into Visual Studio.
Note
If you just need to copy a Visual Studio publishing profile (*.pubxml file) from one installation of Visual Studio to another, you can find the publishing profile, <profilename>.pubxml, in the <projectname>PropertiesPublishProfiles folder for managed project types. For websites, look under the App_Data folder. The publishing profiles are MSBuild XML files.
Videoopenbve Data Publishing Studio Design
Prerequisites
You must have Visual Studio 2019 installed and the ASP.NET and web development workload.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
You must have Visual Studio 2017 installed and the ASP.NET and web development workload.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
- Create an Azure App Service. For detailed instructions, see Deploy an ASP.NET Core web app to Azure using Visual Studio.
Create a new ASP.NET project in Visual Studio
On the computer running Visual Studio, create a new project.
Choose the correct template. In this example, choose either ASP.NET Web Application (.NET Framework) or (for C# only) ASP.NET Core Web Application, and then select OK.
If you don't see the specified project templates, go to the Open Visual Studio Installer link in the left pane of the New Project dialog box. The Visual Studio Installer launches. Install the ASP.NET and web development workload.
The project template you choose (ASP.NET or ASP.NET Core) must correspond to the version of ASP.NET installed on the web server.
Choose either MVC (.NET Framework) or Web Application (Model-View-Controller) (for .NET Core), and make sure that No Authentication is selected, and then select OK.
Type a name like MyWebApp and select OK.
Visual Studio creates the project.
Choose Build > Build Solution to build the project.
Create the publish settings file in Azure App Service

In the Azure portal, open the Azure App Service.
Go to Get publish profile and save the profile locally.
A file with a .publishsettings file extension has been generated in the location where you saved it. The following code shows a partial example of the file (in a more readable formatting).
Typically, the preceding *.publishsettings file contains two publishing profiles that you can use in Visual Studio, one to deploy using Web Deploy, and one to deploy using FTP. The preceding code shows the Web Deploy profile. Both profiles will be imported later when you import the profile.
Import the publish settings in Visual Studio and deploy
On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish.
If you have previously configured any publishing profiles, the Publish pane appears. Click Create new profile.
In the Pick a publish target dialog box, click Import Profile.
Navigate to the location of the publish settings file that you created in the previous section.
In the Import Publish Settings File dialog, navigate to and select the profile that you created in the previous section, and click Open.
Visual Studio begins the deployment process, and the Output window shows progress and results.
If you get an any deployment errors, click Settings to edit settings. Modify settings and click Validate to test new settings. If the host name is not found, try the IP address instead of the host name in the Server and Destination URL fields.
Next steps
In this tutorial, you created a publish settings file, imported it into Visual Studio, and deployed an ASP.NET app to Azure App Service. You may want an overview of publishing options in Visual Studio.
July 31, 2013Publishing a Database Project
Visual Studio 2012 introduced a new SQL Server Database Project. This post first covers what happens when you publish a Database Project. It then details how to publish your Database Project.
See this link for an introduction to the Visual Studio 2012 SQL Server Database Project.
What Does Publish Do?
Videoopenbve Data Publishing Studio Software
- When publishing a Database Project, you define a connection and a database name specifying the 'target' of the publish operation.
- The SQL Server Data Tools (SSDT) looks at the schema of the selected (target) database.
- If the selected database does not exist, SSDT creates a database using the table, stored procedure, data, and other scripts in the Database Project.
- If the database does exist, SSDT compares the selected database schema against the information in the DACPAC and builds an update script. It then runs the update script against the selected database.
- In either case, the selected (target) database schema then matches the schema as defined by the Database Project.
WOW! When you think about this, it is amazing! Especially if you have been doing this manually. No more schema compares in an attempt to figure out the database changes. No more manually developed update scripts. No more issues from running an update script on a database that is a version behind.
With the new Database Project publish feature, each target database is separately compared and a unique update script is generated and executed to ensure *that* target database is updated to the desired schema.
There are a large number of publish settings that you can set to tailor this process. For example:
- Block incremental deployment if data loss might occur.
- If this setting is selected, a change defined in the generated update script may not execute successfully if the change could cause data loss.
- For example, if changing a column from nvarchar(20) to nvarchar(15), data loss could occur.
- If this setting is set, the column change will not be applied.
- DROP objects in target by not in project.
- If this setting is selected, any tables, stored procedures, or other database objects that are in the selected database but not in the project will be deleted.
- For example, if you change the name of a stored procedure from CustRetrieve to CustomerRetrieve, the selected database will still have the CustRetrieve stored procedure in addition to the new one.
- If this setting is set, then the CustRetrieve stored procedure will be deleted.
Now that you know what it does, let’s look at how to do it.
How Do I Publish?
To publish a Database Project:
1) Right click on the Database Project in Solution Explorer and select Publish.
2) A dialog appears allowing you to enter a publish profile, which are settings to use during the publish operation.
3) Click the Edit button to specify the SQL Server instance you wish to publish to (target).
In this case, we are publishing to our development SQL Express database called ACM.
4) The publish script name is defaulted, but you can change it. The publish script file is the file that SQL Server Data Tools (SSDT) create during the publish operation.
5) Click Create Profile to save the entered settings as a named profile. That way you won’t have to enter the settings again next time.
Saving a profile adds a publish.xml file into your Database project with the entered settings.
6) Click Publish to start the publishing process.
The publish processing displays in the Data Tools Operations window with links to view the script or results.
You can create any number of publish profiles. For example, you can create one to publish to your local development database, one to publish to a local test database, and one to publish to the master test database. Just be sure to give each one a clear name.
Double-click on a publish profile to open the Publish dialog using the selected profile.
If there is a publish profile that you use often, such as the profile you use to update your development database, there is a way to set a default.
To set a default publish profile:
1) Right-click on the publish profile file in Solution Explorer and select Set as Default Publish Profile.
2) Then when you select to publish your Database Project, it will default to the setting defined in your default profile:
Use the publish feature any time you want to update (or create) a target database using the database schema defined in your Database Project.
Enjoy!
