Invalid object name error: DACPAC Deployment using SQLPackage.EXE - dacpac

I’m facing an issue when deploying a DACPAC to a SQL server (SQL 2014 – 12.0.2430). Here’s the error I’m getting: invalid object name dbo.usp_SomeStoredProcedure_Update.
This happens if I’m altering a stored procedure. Though, the DB project gets built successfully. I’m using VS 2013 Update 4 for building database solution.
Here’s the command that I’m firing:
“C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SQLPackage.exe” /TargetDatabaseName:DBName /TargetServerName:ServerName /Action:Publish /SourceFile:DBName.dacpac /p:IncludeTransactionalScripts=true /p:BlockOnPossibleDataLoss=false /p:DropIndexesNotInSource=false /p:GenerateSmartDefaults=true
Any idea what might be happening?

Ok, so I went ahead with one work around. I generated the scripts using /Action:Script, and then deployed this script using Invoke-SQLCmd PowerShell command. And, it works.
Not sure what is the exact cause of the issue. But the above workaround works.

Related

Why does my SSIS project not deploy from SSDT 2017?

recently, when I try to deploy my SSIS project from SSDT 2017 I get the following error:
Failed to deploy project. For more information, query the operation_messages view for the operation identifier '2'. (Microsoft SQL Server, Error: 27203)
Moreover, SSIS does not write any message to "operation_messages" - the table is empty. All I get is a non-descriptive entry in the "operations" view.
I have recently recreated the SSIS DB in order to fix the error (did not work), hence the low count in the "operation_messages" view. We have also restarted the database server.
Has anyone had a similar problem and can point me in the right direction.
Cheers!
Edit: I can run the project from SSDT with no problems.
Edit 2:
If I copy the package to my local machine, it deploys without any
issues. On the server, I get the deployment error, even if I try to deploy a newly created empty package.
We have resolved the problem. The final clue came from the Windwos event log, where we found out that SSDT was trying to deploy to a wrong database ("Database..." instead of "DB..."). The wrong information seems to have been retrieved from the sys.servers table. We updated the wrong information by using
EXEC sp_dropserver 'Database...';
GO
EXEC sp_addserver 'DB...', local;
GO
Now I can deploy the project again. I have no idea how the incorrect information ended up in sys.servers, but this has done the trick. Thanks to everyone who tried to help out!

SSIS - package works in VS, fails with "Failed to compiled scripts contained in the package". There are no script objects in the package

VS2017, Deploy to SS2016. Package runs without any errors from VS. Project deployment to a server that previously had package deployments only - we're moving to project deployment, and DBAs said to use that.
Getting many errors like:
Get Error Information:Error: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.
The package has absolutely no script objects. I've checked with the package explorer, and there isn't even a scripts section. To verify, I added an empty script, and then the explorer did show that section.
Other info: Package deployment is new to our DBAs. They are completely mystified by this, and other errors, like:
Get Error Information:Error: CS2001 - Source file 'C:\Windows\TEMP.NETFramework,Version=v4.0.AssemblyAttributes.cs' could not be found, CSC, 0, 0
My opinion, unexpert in SSIS as I am, is that these servers are not set up or configured properly in some way, but I am out of my depth in this, and DBAs are floundering. What might I do to get to the root of this?
I ended up side-stepping the issue by essentially recreating the package. Even XML search revealed no scripts, so the assumption was some kind of corruption. The package was recently upgraded to package-deployment - perhaps that action had a hand in the problem.
We had the same issue and isolated the problem to a Script Task (regardless of language) that existed in a Sequence Container. Placing the Script Task outside the Sequence Container, and upgrading the package to 2016 worked. The package was originally 2012 (as far as I can see) and the server side SSIS was 2016 13.2.5426.0. We were using VS 2017 as well.
For me this was happening because I was targeting the wrong database version. in your SSIS Package project go into properties and set the TargetServerVersion appropriately And then recompile the project and redeploy to sql server.

Visual Studio 2017 SSIS Error (0xc001f041)

No matter which SQL Server version I use I get the following error when I try to drag common tasks (like Send Mail) into the Package:
Failed to create the task.
Cannot create a task from XML for task "", type "" due to error
0xC001F041 "Cannot create a task from XML. This occurs when the
runtime is unable to resolve the name to create a task. Verify that
the name is correct.". (Sequence Container)"
I have no clue as to why that is happening and couldn't find any information on the internet either.
The strange thing is that I can drag the same tasks into the package when I use solutions that we've developed based on Sql Server 2008 R2 years ago. Restarting the machine didn't help. I could try to repair the Visual Studio installation, but I don't really want to lose all of my settings, extensions and such.
Apparently it works fine for a colleague. I deleted all .tbd-files in AppData/Local/Microsoft/VisualStudio, but neither of those files gets recreated when I start Visual Studio. I also tried to restore Toolbox defaults.
Executing the following command didn't help either. The same error is still appearing whenever I try to drop about 3/4 of the tasks into the package.
devenv /ResetSettings
devenv /setup
devenv /resetskippkgs
devenv.exe /InstallVSTemplates
Apparently the only thing that actually helps is to repair VS.

SQL Server SSIS Package Scheduling

We have a package that we created in VS. The package executes perfectly in VS. We then saved and deployed the package to SSIS. Inside SQL Server Management Studio, the SSIS package executes perfectly when done manually. We have 2 packages that we manually execute. We are trying to schedule these 2 packages to run automatically using the SQL Server Agent. When we set up a job and schedule it, the job fails. The first step in the package fails with the error: Failed Validation and returned validation status "VS_ISBROKEN"
We think it has to do with the security on SQL Server Agent, but we have checked and all the permissions seem to be set correctly.
Any help is greatly appreciated!
You should be getting additional error messages other than the VS_ISBROKEN, which will be more helpful in figuring out what's going on. It has been my experience that VS_ISBROKEN almost always refers to an invalid query. For example, the query could be referencing an object that doesn't exist on the target server.
I came across a similar problem in an earlier version of SSMS and found the problem was that the owner of the package in SQL server Agent was incorrect and should be sa or dbo
I don't know if it helps but the symptoms for this seem very similar to mine

Migrating to Azure element default error

I'm trying to migrate a SQL Server 2008 R2 database to SQL Azure, I'm using the deploy database to azure wizard and am getting the following error:
Error SQL71564: The element Default: [dbo].[SystemDateDefault] is not
supported when used as part of a data package (.bacpac file)
I'm getting the same error code referencing a number default and a string default as well. I've never tried this migration before and have no clue where to even start with this.
Anyone had this before or have any ideas what I should be doing?
Thanks
Alex
I started by deleting Extended Properties (as my the error message stated, same SQL 71564 id). I used a script found here:
Drop all extended properties on SQL Server
But after many attempts I found it easier to script the entire db, make some adjustments, recreate the db from scripts and finally deploy to Azure.
I've had a bit of a dig around inside SQL and it turns out this is a default value for a user defined type.
I've removed it and things are going fine now.
Thanks anyway.

Resources