Deploy SQL Database to MS Azure Storage - Error: 40804 [duplicate] - sql

I'm trying to move my databases to a newer Azure subscription. I used to simply click "Deploy to Azure" on a local database from SSMS and have it deployed to a specified Azure server. Importing/Exporting a BACPAC file also works. However, I can't seem to do any of this on the new server. I keep getting the error:
"The service objective 'Web' specified is invalid."
Googling around, I found this thread explaining the need to update the CREATE DATABASE template to accommodate Azure Databases (Azure upgrade, I'm guessing). However, the hotfix provided is specifically for SQL Server 2014 and I'm using SQL Server 2012. I checked other cumulative updates for 2012 here but found no fix for the issue.
Is there any other way I can fix this without having to upgrade to 2014?
Just to summarize my software versions:
SQL Server 2012
SQL Management Studio 11.0.2100.60
Local database: SQL Server 10.50.16000
Old Azure server: SQL Server 11.0.9230
New Azure server: SQL Server 13.0.15

You are getting this error because the latest V12 servers are not supporting the Web and Business Editions anymore. If you don't want to upgrade to SSMS 2014, you can create a V11 server and import your DB on this server. However this is only a temporary solution as Web and Business edition databases will be retired in September. At this point you will have to work with the latest tools to avoid this problem.

There is a Hotfix for it you can download and install on your machine. Please navigate to:
https://support.microsoft.com/en-gb/kb/2936603
You need to enter your email then download link will be sent to your email address. Then install it on your machine and you can see the following options:

Install the database as a Data Project into Visual Studio,
Set the target framework in the properties window to SQL Azure,
Build the project and resolve any unsupported issues.
Publish to your azure site.
I have tried the above and did not work for me - this solution worked!

Related

SSDT failing to publish: "Unable to connect to master or target server"

I'm attempting to use SSDT to publish to a SQL Server database in Azure. When I do so, I am seeing the following error:
Unable to connect to master or target server 'DATABASE_NAME'. You must have a user with the same password in master or target server 'DATABASE_NAME'.
Ignoring the fact that it's listing a database name as the server name in the error, I'm not sure how to resolve it. When I specify the target database, I can successfully Test Connection. I can also connect using the same creds to the database through SSMS.
After researching the error, it seems like it is often that the firewall for the database in Azure does not include the IP address of the machine you're publishing from. It not only contains my IP, but I added another firewall rule to allow every IP (0.0.0.0-255.255.255.255) to eliminate the firewall as a potential cause of the problem.
Any ideas?
This is a known issue. This happens due to the new compatibility level 140 for newly created SQL Azure databases. The issue has been documented here and updating SSDT from here to the latest version may solve the issue.
Alternatively, you can change the compatibility level of your database to 130.
ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = 130;
Hope this helps.
Initializing deployment (Start)
Initializing deployment (Failed)
*** Could not deploy package.
Unable to connect to master or target server 'DbName'. You must have a user with the same password in master or target server 'DbName'.
Issue occurred while deploying build through VisualStudio-2015 and it support to publish database on the database servers whose version up to only 2016.
Solution: For SQL server 2017 we need to Publish Database with Visual Studia 2017 only. Need to upgrade SSDT.
Faced same issue when trying to deploy a DB from local SQL Server to Azure SQL DB via SSMS.
Tried to alter source DB's compatibility level to 130, still got same error.
Tried to add same user logins to master DB, no help.
Eventually, started looking for other approaches. Succeeded by using Data Migration Assistant, as instructed in https://learn.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate.
My situation was slightly different in that I had exported an Azure database (with compat level 140) from SQL Azure and then tried to import it into a local SQL Server 2017 installation - using the latest SSMS 2017 that I just installed yesterday - and still got this message.
Turned out that although I did have latest SSMS installed, I was actually opening SSMS 2016 by mistake! So be sure to select and pin the correct version to avoid it happening again. Just typing 'SSMS' into the Windows Start menu may not show both.
So if you use SSMS to import you only need the latest version, and no separate tools.
Footnote: Even after opening the correct SSMS version I got another error - something about contained databases.
An Azure database is a 'contained' database (or at least mine was) - meaning that its user logins are embedded in the database. This isn't enabled by default apparently in standard SQL Server 2017.
After running this in the local SQL in master I was able to import it successfully.
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO
When this happened to me it was due to the version of tools I was using. I thought it strange that the most recent SqlPackage.exe I found in C:\Program Files (x86)\Microsoft SQL Server didn't work and publishing from visual studio did, so I found the most recent
under the visual studio directories:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150\SqlPackage.exe
* to publish to a SQL Server database in Azure*, you can use "Data Migration Assistant" (DMA).
I just tried it and it works smoothly without any issues (firewall and compatibility level)
please refer to this link SQL Server database migration to Azure SQL Database
for step by step: 10. How to migrate the SQL database to Azure with the Azure Database Migration Service
I got the same error while trying to update a local SQL Server database from Visual Studio database project (i.e. not i Azure). Turns out the problem was I was running SSDT for Visual Studio 2017 while using Visual Studio 2015. Visual Studio discovered an updated version of SSDT (just happened to see it in notifications!), pointing to the right Visual Studio version. Now it works!
My setup: BizTalk Server 2016 forces me to use Visual Studio 2015. My local database is on SQL Server 2017. Using SSDT for Visual Studio 2015 works for updating databases in SQL Server 2017. Just so you know. ;)
Most of the sources recommend to set COMPATIBILITY_LEVEL = 130; and, usually, it solves the issue. Unfortunately, this did not help me.
In my case, I had to downgrade SQL Server 2017 on my machine to SQL Server 2016 Developer Edition.
I ended up having to install DacFramework.msi on the SQL server that my azure runner agent was installed to get past this error. My server is a VM running in our network. not running in azure...
the description on the msi says:
'This installer database contains the logic and data required to install Microsoft SQL Server Data-Tier Application Framework (x64).'
Try to connect to the SQL Azure database using Sql Server Management Studio and the ip getting listed in the management studio is the right ip address. Try to add to the SQL Azure firewall rules. The ip address listed in the firewall page of Sql Azure portal is not accurate.

Unable to browse Integration Services on SQL 2016

I've installed SQL Server 2016 (Standard Edition) on a Windows Server 2016, selecting Integration Services to be installed too. I've also installed SSMS and SSDT from the same installation media.
I am running SSMS as administrator and can connect to the local Database engine.
My user is a Windows and SQL Server admin.
However I cannot connect (explicitly using the server name) or even browse to the local Integration Services?
Receiving the following error.
SSIS not browsable and can't connect
Having already searched for an answer to this problem, many suggest checking that the service is running etc. which can be seen in the Services and SQL Configuration Manager.
Services shown as running
I've also tried turning off the Windows Firewall to establish if that is the cause of the problem but it had no effect.
Anyone got any ideas what might be preventing it from being accessible?
I've had this problem last month. In my case I had to install the 32-bit version of access database engine (on my 64 bit windows).
Sql data tools works with 32-bit
https://www.microsoft.com/en-us/download/details.aspx?id=54920
The later SSMS versions (16.x and 17.x) will only connect to their respective versions SQL 2016 and SQL 2017. Microsoft is planning to retire the older method in favor of the SSISDB, which is more secure.
Link to the official statement from Microsoft (in the note box).
I have had the same problem and the solution was to install the old interface on top of the existing one (SQL Server Management Studio 2016). Here's link to the installation file. After having installed this, I can now connect to the integration services. You will have to set it up of course and give yourself Rights

After installing SQL Server 2014 Express can't find local db

I have downloaded and installed SQL Server 2014 Express
(from this site: http://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx#Installation_Options).
The problem is that I can't connect/find my local DB server, and I can't develop DB on my local PC. How can I reach my local server?
My system consists of Windows 8.1 (no Pro or Enterprise editions) 64 bits
Checking the configuration of SQL Server with SQL Server 2014 Configuration Manager tool, I see an empty list selecting "SQL Server Services" from the tree at the left. Below you can find a screenshot.
In the Windows Services list, there is just only one service: "SQL Server VSS Writer"
EDIT
My installation window of SQL Server 2014 is the following:
Most probably, you didn't install any SQL Server Engine service. If no SQL Server engine is installed, no service will appear in the SQL Server Configuration Manager tool. Consider that the packages SQLManagementStudio_Architecture_Language.exe and SQLEXPR_Architecture_Language.exe, available in the Microsoft site contain, respectively only the Management Studio GUI Tools and the SQL Server engine.
If you want to have a full featured SQL Server installation, with the database engine and Management Studio, download the installer file of SQL Server with Advanced Services.
Moreover, to have a sample database in order to perform some local tests, use the Adventure Works database.
Considering the package of SQL Server with Advanced Services, at the beginning at the installation you should see something like this (the screenshot below is about SQL Server 2008 Express, but the feature selection is very similar). The checkbox next to "Database Engine Services" must be checked. In the next steps, you will be able to configure the instance settings and other options.
Execute again the installation process and select the database engine services in the feature selection step. At the end of the installation, you should be able to see the SQL Server services in the SQL Server Configuration Manager.
I downloaded a different installer "SQL Server 2014 Express with Advanced Services" and found Instance Features in it. Thanks for Alberto Solano's answer, it was really helpful.
My first installer was "SQL Server 2014 Express". It installed only SQL Management Studio and tools without Instance features. After installation "SQL Server 2014 Express with Advanced Services" my LocalDB is now alive!!!
I have noticed that after installation of SQL server 2012 express on Windows 10 you must install ENU\x64\SqlLocalDB.MSI from official Microsoft download site. After that, you could run SqlLocalDB.exe.
Just download and install LocalDB 64BIT\SqlLocalDB.msi can also solve this problem. You don't really need to uninstall and reinstall SQL Server 2014 Express with Advanced Services.
Also, if you just installed localDB, you won't see the instance in the configuration manager. You would need to initiate it first, and then connect to it using server name (localdb)\mssqllocaldb.
Source
I faced the same issue. Just download and install the SQL Server suite from the following link :http://www.microsoft.com/en-US/download/details.aspx?id=42299
restart your SSMS and you should be able to "Register Local Servers" via right-click on "Local Servers Groups", select "tasks", click "register local servers"

SQL Server Data Tools on Azure VM

I created a VM using the gallery image, and got SQL server 2014 Standard template and got reporting services working correctly. My questions here are all about the Azure VM image, which I'm sure the community is using as well (no SSRS in Azure other than using a VM)
ReportBuilder however will not start from a remote client (401 unauthorized), and I'm sure I have to open another port or something to get it working but I can't seem to find the right article....
I'm also told that SQL Server Data Tools (SSDT) is installed on the server, in order to create reports via Visual Studio. However, I can't seem to find the right link on the server (damn this new Server 2014 interface! hard to loose the muscle memory of the previous os) What is the start up procedure for SSDT on the VM?
I've also tried using the Browser directly on the VM, but without JavaScript enabled, that wont' work as well. How do I drop (temp) all the constraints it's under?
In essence, how do you create a report on the Azure VM?
If you can access the report server from a browser in a remote client, for example, yourazurevm.cloudapp.net/reportserver, then you have already configured firewall correctly. Otherwise, refer to this article (http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/#SSMS) to configure Azure SQL VM.
To create reports using ReportBuilder, install the standalone version of the ReportBuilder 3.0 from http://www.microsoft.com/en-us/download/details.aspx?id=6116. After you launch the ReportBuilder, you can configure it to connect to your Azure SQL report server in the lower left corner.
To create reports using Visual Studio and SQL Server Data Tools (SSDT), install SSDT-BI (not just SSDT) in the client where Visual Studio is installed. Then create a Report Server Project by going to File->New->Project->Installed->Templates->Business Intelligence->Reporting Services. Open the properties of the project, and set the Target Server URL to your Azure SQL report server.

Microsoft SQL Server 2012 Expired

I've been working on this ASP.Net Project for a few months, and today my SQL Server 2012 Management Studio has expired. Completely overlooked that i may have been using a trial version and not the express edition. I can not access SQL management studio as it says the evaluation has expired.
Is there a way i can downgrade to the express edition (Free), without losing any databases?
Is there a way i can still backup/export the database i have been working on? Ive tried using the import/export 64 bit tool, but ive forgotten my sql server password. I had just been using the default all this time.
Thanks
Backup database: You can get close backup of your databases by copying the data and log files from your Data directory. You can do this just using Windows copy and paste command.
Re-install from trail version: I faced this problem for SQL Server 2008 trial version. When SQL Server 2008 expired, I was able to re-install it as follows:
a) Remove or uninstall all tools of SQL Server completely from Control Panel > Programs and Features.
b) Then, re-install SQL Server as a new fresh tool.
c) After completing the installation successfully, Cope and paste those backup data and log files into new data directory of new installation.
d) Open SQL Server Mgmt Studio and attach the data file to re-create your old database. Your database will be resumed in this way.
I believe you can do this procedure for your SQL Server 2012 trial version too.