SSAS Cube Process in Job fails - sql

I have some ssis packages & a cube to process in my job scheduled.
When I process the cube in visual studio, its working fine even I tried it manually in analysis services of sql, it works there too.
But my job fails saying the step of process cube.
Here is a part of the error message:
A duplicate attribute key has been found when processing: Table: 'dbo_Customer', Column: 'Updated_By', Value: '
Please help me.

I had done it at my own , One of my Excel templates have no value assigned in "updated by" column & so the database have no value in it. It coming as blank. so creating issue while processing cube.

you should read about the UnknowMember on the dimension. It is common to come across situations where
you have a Fact not related to a dimension.
Basically what it does is when facing this situation, instead of breaking the refresh it will substitute the missing value by whatever you have configured on the UnknowMemberName (N/A for example)

Related

SqlException: Data modification failed on system-versioned table because transaction time was earlier than period start time for affected records

I m getting the above error when running the Web Job in multi-threaded environment. I m calling one stored procedure to perform some action, stored procedure has code which Inserts/Updates/Delete records from pretty big temporal tables(3-4M records[not sure if its relevant here]). Every time the job is run it deals with(Insert/Update) around 40K-80K records based on condition. When the single thread is running everything goes fine. But as soon as number of parallel jobs count is set to 2 or more I m getting the error. From initial analysis seems like issue is with Auto generated column values with for SysStartTime and SysEndTime in history table. I have tried one of the solution from internet to reduce 1 second from the date to be saved in those columns as below
DEFAULT (dateadd(second,(-1),sysutcdatetime()))
But its not working. I have read few articles where it says temporal tables does not work properly in multi-threaded environment. Now I m not sure why the issue is happening and how to resolve this in multi-threaded environment.
Can someone here please help me understanding the reason behind the error and how to fix it.
NOTE: I can't make my code to run on single thread. Minimum three threads are required. Converting to single thread is not solution in this case.

Google Data Studio can't explore Big Query time partitioned table

When trying to explore a Big Query Table in Google Data Studio after having connected to it I get the following error. Any Ideas how to handle that or what it means?
The query returned an error.
Unrecognized name: _PARTITIONTIME at [1:167] Error ID: a6e0a88c
In your Data Studio editor, click resources --> manage added data sources then go to edit connection.
There is an option to use _PARTITIONTIME as the time dimension.
I suspect Data Studio has picked up this magic field and tried to use it as a time datatype and there is some incompatibility going on. I think this field is really metadata so shouldn't be used. Data Studio should really ignore it and not try to be too clever in finding your fields and inferring their usage & type from their names ( Although, mostly that is helpful ).
Unticking that option, clicking back to the report with Done will let you resolve the issue.

Pentaho Execute SQL Statements variable conversion to null

I am using PDI to delete and insert some data from a DB. I have the following issue. I create two variables called START_DATE and END_DATE that are used to select the data that will be deleted from my DB. I am able to get them and run my transformation with no erors in the log file, but when I checked if data was deleted, I find it didn't. I send checked my "DeleteProcedure" step, and it says "Conversion error: null". I have tried different approached to take the variables and pass them as Strings, but I haven't been able to solve this issue. It cannot be a SQL mistake as I tested it with a constant and it works.
Any ideas? I attach some pics. Thanks!
As a documentation of the Execute SQL script says:
Note: When you have an issue, that the SQL is started at the initialization phase of the transformation and not for each row, make sure to check the option "Execute for each row" (see description below).
In your case it executes during the initialization phase of the transformation that's why it gets null values instead of ones from previous step.

SQL job failing only on particular instances

We have an application ,where the session data of the application is stored in a table, from that table we have a SQL job which places the above data in one more table segregating it more meaningfully.
When we created the job ,the job passed in DEV environment and TEST ,but when we implemented the job in production and stage, the job is failing with below error.
Conversion failed when converting date and/or time from character
string
We tried restoring the DB to some other instance other than where the application DB resides and the SQL job is completing successfully. The Job is failing only in the instance where application DB resides.
Steps what we tried:
We tried comparing the SQL configuration of the instances where the job completed successfully to the instance where it is failing, no differences
we tried executing the stored proc manually writing some print statements to see if it really a code issue, this didn't helped us since the job is not failing for a particular session GUID and the same step is passing in DEV environment.
We are not able to figure out why this is happening only on instances where application DB resides.
"Conversion failed when converting date and/or time from character string". This is error is based on data. It has a string which is not in required format to be converted to a data. The issue is not with code, its with data. Add a preprocessing step to convert data to requires format.
Check the default language of the server account the job is being run under - my guess would be something similar to DEV/TEST's account being set to British English while LIVE is set to English.
However, even if that is the case, this still only indicates why the issue appears on LIVE. The underlying thing you should do to correct this is make sure that your job makes no assumptions about date formats, does not do any implicit date conversions, and holds dates in date variables/columns, not character ones.

Getting around cyclical foreign key errors when trying to generate insert data scripts in SQL 2008

I am trying to generate some insert scripts using the SQL Server 2008 Script Wizard. Upon generating the scripts, I get the following error:
"The selected database contains foreign keys that create a cycle. Publishing data only is not supported for databases with cyclical foreign key relationships."
I've attempted to disable and remove all constraints in the database. The error is still occurring. Is there any way to get around this? Possibly make SQL ignore the constraints while generating the scripts.
On the Wizard page where you choose the radio button to select All Database Objects or Specific Objects, make sure to select All Database Objects. For some reason the tool needs something in there to generate even if you just want the table insert script.
Once I changed that radio button to All Database Objects, and selected the Advanced option to generate Type of script = Data Only, it worked all the way through.
I had the same problem as the OP. Then I tried again, this time in the advanced options, for the "types of data to script" option, I selected "schema and data" rather than data only. Then it worked for me without complaining about cyclical keys.
I was having the same issue, and I discovered today that you can use SQL Server Management Studio 2012 against a 2008 R2 DB and you won't get the error:
Sql Server Scripting Data Only: Workaround for CyclicalForeignKeyException?
Saving to file vs. to a new Query editor window seems to make it work for me on Management Studio 2008 :\
First off IMHO HLGEM's response is a bit cavalier--there are valid reasons at times to have cyclic references.
That said I think the script generator is hyper-sensitive. It seems to think just about any PK/FK pair is "cyclic" and I ended up having to use a copy of my database from which I'd stripped all keys to get the export to get beyond the "cyclical" error. A script like the following can help you drop keys globally but of course be careful!
SELECT
'ALTER TABLE ' + object_name(parent_obj) + ' DROP CONSTRAINT ' + [name]
AS Script
from sysobjects where xtype IN ('F')
[I didn't write this. See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=46682]
Further the tool is pretty useless in terms of feedback since its report doesn't provide enough detail to narrow down where the supposed cyclical references exist.
Finally I found the tool to be pretty flaky in that I get random timeouts. One other observation that I haven't researched extensively is I think the tool may require you to start from scratch after the cyclical error to clear it's cache since I see different behavior when I use Previous button vs. starting afresh.
You can export the data by setting the script option - "Script Check Constraints" to False
Sorry this will not work :(
You will have to determine which table is causing the issue.
I was getting the same error because I didn't had a table selected in the object list (one big table I wanted to create in another script). Selecting all of the tables solved the problem.
PD: Maybe a little bit late, but searching CyclicalForeignKeyException gets first in Google.