SSIS Error - No object exists with ID 0 - sql-server

I deployed an SSIS 2016 package last week after updating an SQL statement. I deployed by simply right clicking the package in MVS and choosing deploy.
It's run properly for the last week, but last night we got errors. The error description is simply No Object exists with ID 0.
I took a quick look at my code, and there's a Script Transformation that calls C# with PipelineVersion==0. It's part of an error handler so, it wouldn't be called regularly. Could this be the cause of my error?
And what can I do in my deployment to avoid this error?

So, I was able to resolve the issue by opening the script, rebuilding it, and rerunning the SSIS.
I'm wondering if there's anything that can be done to avoid this issue in the future. It makes me look pretty bad to the client when this happens in production.

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!

How I know any particular one command is failed while deploying/publishing data in Database?

I have created database project in visual studio 2013. Project build successfully . In this project I have inserted some test data in post deployment. If any data failed to insert then how can know the one of script is failed at particular location.
Actually I want to rollback all the thing if any command is failed from script file itself. Since SQL Server 2012 is not supporting rollback from pre/post deployment script.
The result window will give you the line and details of any error, it is a bit annoying as it will sometimes show the text of the beginning of the script but the error line number will be correct.
General things you should do is to make sure your insert scripts are re-runnable and then if you really can't see the error you can run the script yourself to debug it.
I would really recommend using MERGE statements to do the inserts :)
I also generally recommend using sqlpackage.exe to push to local Deb instances rather than the vs publish, see:
https://the.agilesql.club/blog/Ed-Elliott/Visual-Studio-SSDT-Publish-My-Personal-Best-Practices
Ed

Why is my data model and SQL generated by EF different on my web server?

This issue is so strange to me I don't even know how to explain it. Let me start by saying everything is working fine locally. The problem started when I published my app to a web server. At first I was getting "The model backing the 'DataContext' context has changed since the database was created. Consider using Code First Migrations to update the database". Strange because I didn't make any changes in my data model. First thing I did was deleted the database then ran update-database to create it again using code first migrations. Tested locally worked fine then published (deleting everything) and got the same error. I then set the initializer to null and removed the IncludeMetadataConvention. Deleted db, update-database, publish. Now I am getting an error "Invalid column name 'Item_ID'". Ok that makes sense because I have no column 'Item_ID' in my database. Running SQLProfile I can see that the sql generated locally is not including the column but when run on the server it does. After hours screwing around looking for incorrect connection strings or any other little thing I may have missed, I decided to just copy my entire local folder manually to the web server. Still same error. I no longer know where to look and would like any ideas or suggestions. Let me know if I can provide any code that may help.
I recently found that if I use CreateDatabaseIfNotExists<DataContext>() and let the db get created on the server it will work from the server but not locally.

SQL72043 and other SSDT errors: how can I find the incorrect code?

So, I've got a project in SSDT (SQL Server Data Tools) in Visual Studio 2012. When I build this project, there are no errors - it builds fine (not even a warning or a message).
However, if I try and publish I get:
The script file could not be found (no more information).
If I schema compare the project with an existing database, all I get is:
Cannot generate deployment plan (again, no more information).
Only when I do 'Run Code Analysis' do I get an error that could possibly mean anything:
SQL72043: 7 elements are in an error state
I know this error can be caused by a missing comma in a table definition or similar trivial errors, but I've been tearing my hair out for hours looking through every line of SQL code in the project to find a problem. Is there any way I can shed more light on what lines of my code are causing the error?
Delete the dbmdl file in your database project.
You can just go to IDE menu 'Project' -> 'Reanalyze Project' and then rebuild your database project to get rid of this error on Publish command.
Deleting the dbml files didn't work for me, but to get the schema compare to work and not recieve the Cannot generate deployment plan error, I switched the source and target and compared the schemas again.

Errors While deploying SSAS 2005 Cube on Server

I am stuck with something really nasty here. I have a SSAS Cube that was working fine till day before yesterday. Had some performance issues on the server and got cummulative patch 938077 on top of Service Pack2.
Since then I have not been able to deploy the cube - with a strange error -
File System Error: The following error occurred during a file operation: Access is denied.
I am administrator on the machine, have possibly checked the whole of file system for permissions. Have deleted the existing cube, stopped services, server, tried redeployment - nothing works.
Unfortunately I forgot to take a snapshot of pre-patch image, so cann't restore back. Only option I am currently left with is to rebuild the server, if I cann't fix this.
Strange but I cann't find anything on any forums about this.
Yes, one more strange thing related to this - I had SSIS package, to load DW (datasource for above cube), and strangely I have lost all my Data flow tasks. Something wierd is really going on and I cann't trace it.
Any suggestions or help would be great. I just cann't think of anything right now.
Cheers!!
Vineet
Figured it out, its more of a permission issue on the server than with the cube itself. Ran the SQL services under Local System account (after new security patches applied without us knowing it) and it worked fine.

Resources