Unable to publish DB project on Azure SQL Data Warehouse - visual-studio

With Visual Studio 2019 (already updated to the latest version), I have created a new SQL Server Database Project connected to an Azure SQL Datawarehouse Database.
I imported all the object already present on the database (tables, stored procedure and schema), I carried out the schema compare which does not detect any difference.
On the project properties I changed the Target platform setting it up on Miscrosoft Azure SQL Data Warehouse, I switched the Compatibility level setting it on SQL Server 2017 (140)
The build of solution is successful, but when I tried to publish the solution I have the following message error
Creating publish preview...
Errors occurred while modeling the target database. Deployment can not continue.
I can generate the publish script only if I check the box Always re-create database, but I don't want drop and re-create the database every time
I did a lot of research but none of them solved my problem.
Anyone knows if there are any known limitations concerning the publish of SQL Server Database Project on Azure SQL Datawarehouse Database or does anyone know how to solve the problem?
Thank you

Deploying database projects to Azure SQL Data Warehouse is in public preview since August if you use Visual Studio 2019 SQL Server Data Tools (SSDT) as documented here. At the bottom of the page Microsoft gives you instructions on how you can provide feedback directly to the SSDT team.
Database projects were not supported on Azure SQL Data Warehouse as you can read here and here.

Check your database tables in the "System Tables." If you have dbo.sysdiagrams,
that won't allow you to deploy the db.
So, if you delete dbo.sysdiagrams table on your database, that will hopefully allow you to deploy the database.
They get created when you click on the database diagrams.

Related

Corrupted Collection Database after an unsuccessful TFS 2015 "update 2" to "update 3" upgrade process

I've upgraded an On-Premise TFS instance from 2015 update 2 to update 3. the process failed for some reason (I think it was related to user permission to alter db schema - ddl).
Now the DB is corrupted, the TFS admin console "thinks" the DB is ready for TFS 2015 update 3 but i get an error trying to query for work items in the web portal.
Invalid column name 'IsDeleted'.
Is there a way do downgrade the schema?
Is there a way to 'trick' the DB to be in "update 2" state so the upgrade process will run again?
Any way to recover my work items? I don't mind copying them to a new collection or team project.
Thanks.
The DB's extended properties are:
TFS_DATABASE_TYPE Collection
TFS_PRODUCT_VERSION 14.0.23128.0
TFS_SCHEMA_VERSION Microsoft Team Foundation Server 2015
TFS_SERVICE_LEVEL Dev14.M102
and the Configuration DB's extended properties are:
TFS_DATABASE_TYPE Configuration
TFS_DEPLOYMENT_TYPE OnPremises
TFS_PRODUCT_VERSION 14.102.25423.0
TFS_SCHEMA_VERSION Microsoft Team Foundation Server 2015 Update 3
TFS_SERVICE_LEVEL Dev14.M102
EDIT
After using SQL Profiler I was ending up changing one of TFS's Views:
vw_denorm_WorkItemCoreLatest.sql
If anyone have figured it out please share.
Try recreating TFS Data Warehouse and Analysis Services by following this article: Rebuild TFS Warehouse and Analysis Databases From Scratch.

DataBase project in Visual Studio

I have two database projects in Visual Studio which is purpose to deploy databases separately. First database project deploy DBFirst and second database project deploy DBSecond. DBFirst database is created successfully but I am struggling with second.
DBSecond contains stored procedures and views. Some of them referenced to DBFirst and DB project failed during the build process. Example I have following view in DBSecond:
CREATE VIEW [dbo].[DBFirst_CLM_Details]
AS
SELECT *
FROM [DBFirst].[dbo].[CLM_Details]
GO
That project failed during the build because it cannot resolve reference DBFirst. If I change "Build Action" property from Build to None project will build but it will skip that file.
How can I deploy that view and similar objects which have references to another database? I am using VS 2013 and target platform is MS Azure SQL Database
Thanks
Cross-database references are not supported by Azure SQL Database. If you need it you should go and vote for it to help prioritise its delivery. If you need the capability today you will need to invest time in querying and combining the data elsewhere in your application outside of Azure SQL Database.

Visual Studio Project that execute an SQL script

I have this question... probably is similar to Executing scripts from a database project in visual studio
but i didn't understand the solution given.
So i made a Database Server 2008 project inside visual studio.
Just one table. When i press DEPLOY the database is created inside SQLServer2008 and the table is created.
Now what if i would like to give the project to someone who has SQLServer and he needs to recreate the database and the table in his computer?..
Apart form executing the query from Visual Studio is there any way to create an executable that automatically "deploy" from outside Visual Studio?..
Thanks,
There are different types of Database projects in Visual Studio. The old ones, which were not so feature rich. The 'Data Dude' ones that came with Visual Studio 2010 Team Database Edition and the most recent iteration that comes with the SQL Server Data Tools. All of these can be installed on top of the standard Visual Studio Professional and don't require additional licenses.
SQL Server Data Tools is the latest, and also the best integrated and most powerful variant of the bunch. It can also be used to compare existing schema's and generate upgrade scripts or automatically upgrade the schema in an existing database for you.
During build, a package will be created that holds all the schema information for your database. You can then use the command line tools provided by the SQL Server data tools or MSDeploy to deploy your compressed schema file to a new or an existing database.
This deployment mechanism can also upgrade existing schema if needed.

VS2010 Database Projects and SQL Server 2008R2

I am trying to create a VS2010 SQL Server 2008 database project for a SQL Server 2008R2 database. When I attempt to import an existing database a window popups up with the following message "The database that you selected is not supported."
Does anyone have any idea why this is happening?
Note: I have managed to create a database project that happily allowed me to create a table in the master database on the same SQL Server 2008 R2 database.
Thanks
Ok so I figured this one out myself. I think this may be related to my uninstalling some software / database driver that had a connection reference in Visual Studio which was not cleaned up.
Basically to fix the problem I closed Visaul Studio and then deleted this file.
C:\Users...\AppData\Roaming\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView
Here is a link to the question and answers that helped me out:
http://connect.microsoft.com/VisualStudio/feedback/details/552006/unable-to-create-data-connection-in-server-explorer
Probably your existing database has different version. Try this: How to: Change the Target Database Version

Publishing a SQL Server Database project

I've created a SQL Server database project that correctly deploys a database on my machine. However, I need this project to create databases on QA's machine. They do not know how to create a database from a script.
Is there a way a database project in Visual Studio 2010 can be published so all a non-technical user has to do is click an executable and the database will automatically install?
What you are looking for is this MSDN article: Deploying a Database by Using the Database Publishing Wizard.

Resources