Error in deploying SSAS cube to SQL Server Analysis - sql-server

I am having issue deploying SSAS package to SQL Server Analysis. It is complaining of duplicates keys whereas the column is referencing is not a primary key column. I queried the dimension table to see that the primary keys have same values in the affected columns which is normal and possible. The attribute usage and type property are already set to regular in SSDT. Please find the error I am receiving below. I will appreciate an idea to fix this issue. Thank you.
Errors and Warnings from Response
Server: The current operation was cancelled because another operation
in the transaction failed. Errors in the OLAP storage engine: A
duplicate attribute key has been found when processing: Table:
'dwh_Dim_By_Answers', Column: 'QB_AnswerText', Value: 'hazard'. The
attribute is 'QB Answer Text'.

Their is two solutions for this issue :
to avoid key duplicate error when processing a dimension you just need to set the dimension property ProcessingGroup to ByAttribute instead of ByTable.
Force SSAS to ignore key duplicate error by setting KeyDupplicate to IgnoreError in dimension key errors tab. To achieve this go to SSMS OR SSVS -> process -> in process tab click change setings -> dimension key errors -> Use costume error configuration -> set KeyDupplicate to IgnoreError.
visit : https://www.mssqltips.com/sqlservertip/3476/sql-server-analysis-services-ssas-processing-error-configurations/

Related

SSAS - Ignore "attribute key not found" error

I have a cube which is unable to process anymore because of a missing key in a dimension.
The process cube action kept returning the following error message:
The attribute key cannot be found when processing: Table: 'MyFactTableName', Column: 'MyDimensionKey', Value: 'Value'. The attribute is 'MyDimensionKey'.
To explain the situation: I have a fact table FactSales with multiple columns of which ProductID is one. ProductID is a key from the table DimProducts.
The problem however is that one record in the fact table has a productID, which does not exist in DimProduct.
The problem lies with the ETL, but I have no access to that and the one having access is not available for 2 weeks. I only have the SSAS project I can work with.
So my question: is there a way (a property in the dimension/attributes etc for example) to temporarily ignore this error and still process the cube? I heard about settings that can be set in SSMS when processing manually, but this has to be done daily (with a SQL job) too, so I am looking for an option in my SSAS solution itself
I think there are two ways. When you process the cube, in the processing options you can specifically set to ignore dimension errors and continue.
Likewise,i think you can set this in processing options in visual studio for the dimension.
Longer term, it may be wise to change the etl so that any missing keys are assigned to a generic missing key to prevent further cube processing errors and let you fix the error properly

Could not create foreign key constraint. There are 'NIF' values of entity x (new table) with no corresponding value in entity y

I'm struggling a bit to overcome this obstacle that is to create a table with a foreign key to another table. It looks simple right? It is, but unfortunately i'm not being successfull. The error thrown is the one in the title. Has anyone else had this error before? How did you resolved it? I'm using SQL Server 2014 but the error is thrown through Outsystems IDE.
Best regards,
Rafael Valente
It would help if you could post a picture of your datamodel for us to take a look.
One way of dealing with this kind of errors in OutSystems is inspecting the database itself. There's a system table called ossys_espace. Get your espace id from there. Then query ossys_entity to see which is the physical table name for that entity and check if there's something wrong with it.
There's also the possibility that you've created a table in the past that is causing the error. Check for the entities with the flag deleted set to true in that table. If it helps, there's this Forge component that you can you to clean those deleted entities.
If you have access to the server you can also look at the generated SQL and understand if there's a problem with it.
I find that error weird, but you might be bumping into a bug, and for sure we want to know that :)

SQL Server BackEnd Access Front-End ODBC Error

I can read/write/update the table fine in SSMS, I can open/read/write the table fine if I open the table itself in Access 2013, but if I try to query the table, I get the generic access error message of
ODBC -- call failed
This table has 558,672 rows in it. I have tried using a DSNLess connection with VBA as well as a manually linking the table in through the toolbar in access. What is causing access to throw this error?
EDIT
I have also tried to compact and repair the database to no avail.
EDIT #2
It seems that only one element (a subform) is throwing the ODBC error. The peculiar thing is the main form is based on the same datasource that the sub form is, but only the subform is throwing an error?
I had this problem before here are the thing I had to change to access table with MS Access and edit it.
1.your tables should have a primary key. In the column properties, set identity specification to yes, and Identity increment by 1. I would prefer to set a completely new column with int data type.
2. No null values in boolean fields everything should be 1 or 0. and set a constraint to 0.

SETPARENT FAILED FOR FULLTEXTINDEXCOLUMN

Using SQL Server 2005 Enterprise. I'm trying to add columns to a full-text index created on an indexed view with schemabinding.
Here's the full error message:
Cannot execute changes
SetParent failed For FullTextIndexColumn 'geo' (Microsoft.SqlServer.Smo)
Value cannot be null
Parameter name: newParent (Microsoft.SqlServer.Smo)
I'm not sure how to proceed...Google has turned up nothing, and the "geo" field does not contain NULL values.
Any suggestions?
Thanks!
I ended up dropping and recreating the view with additional fields. Not sure why that was necessary. I'll leave this question open for another day or so in case anyone can offer some insight.

Is it possible to define error message for UNIQUE KEY constraint in SQL SERVER when it is called by EF 4.0?

I don't need to execute duplicatation query like checking some column is unique or not because this operation always execute with SQL Server constraint. However, default error message from SQL Server is not well-defined for end-user.
Do you have any idea for change/redefine error message to be more user-friendly?
PS. I execute all query via Entity Framework 4.0.
The only way I know to do this is to catch SqlException and then check the Number property. This property is a short-cut to the first Error in the Errors property, and if you are worried about the possiblity of multiple error conditions, you could use that instead.
Once you know the sql error number, you can provide a more user-friendly message. Unfortunately, I do not know of a way to get a nice list of common sql server error numbers, besides doing select * from sys.messages, but it can be a little overwhelming to search through them.
I only cared about a few specific error numbers and created the error conditions manually to determine the numbers:
547 foreign key conflict
2601 unique index violation
2627 primary key violation
On any other error number, I just provide a generic message indicating that there was a problem with the database. In all cases, I log the exception information for later use (using NLog).

Resources