SSIS update SQL task with problem ole db command - sql-server

I have a table with 2 calculated column and I write a SQL command in OLE DB Command for update table
But it run with error
UPDATE [dbo].[FctRides]
SET
[trip finish]= case when [Finish] is null then [Expire] else [Finish] end
,[trip duration] = DATEDIFF("MI",[Start],(case when [Finish] is null then [Expire] else [Finish] end))
,[VendorId] =?
,[VehicleId] =?
,[RegionId] = ?
,[Status] = ?
,[Book] = ?
,[Start] = ?
,[Finish] = ?
,[Expire] =?
,[SourceId] = ?
,[DestinationId] = ?
,[Distance] = ?
,[Tariff] =?
,[Cost] = ?
,[Deleted] = ?
WHERE [RideId]=?
The Output message is
Information: 0x40043009 at bicycle_fact_rides, SSIS.Pipeline: Cleanup phase is beginning.
Task failed: bicycle_fact_rides
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "C:\Users\Shahram\source\repos\ssis bicycle\ssis bicycle\Package.dtsx" finished: Failure.

I change My OLE DB Source and config again. the then problem solved
Data flow diagram
OLE DB Command

Related

Getting "Failed to start system task System Task" - Airflow DAG/SQL Server

After I triggered and refreshed the dag task, it went from running, delayed, to failed. The error log from the airflow told me to check the error from sql server which I got "Failed to start system task System Task" when I checked the logs on my sql server docker container. I'm not sure if I need to specify a schema but the rest of the connection params are correct.
[entrypoint.sh]
"${AIRFLOW_CONN_MY_SRC_DB:=mssql+pyodbc://SA:P#SSW0RD#mssqlcsc380:1433/?driver=ODBC+Driver+17+for+SQL+Server}"
[dag.py]
with DAG (
'mssql_380_dag',
start_date=days_ago(1),
schedule_interval=None,
catchup=False,
default_args={
'owner' : 'me',
'retries' : 1,
'retry_delay' : dt.timedelta(minutes=5)
}
) as dag:
get_requests = MsSqlOperator(
task_id = 'get_requests',
mssql_conn_id = 'my_src_db',
sql = 'select * from Request',
dag = dag
)
The issue was just that it couldn't notice the table so I specified the database which fixed the issue even though the database should of been recognized since I've passed it on the connection string.
sql = 'use csc380db; select * from Request',

Getting a Package Validation Error for Row Count SSIS

New to SSIS. I'm trying to connect OData Source [SharePoint] and just want to view it in the SSIS Package. When I run my solution, it comes up with the following error message:
> TITLE: Package Validation Error
> ------------------------------
>
> Package Validation Error
>
> ------------------------------ ADDITIONAL INFORMATION:
>
> Error at Data Flow Task [Row Count [50]]: The variable "(null)"
> specified by VariableName property is not a valid variable. Need a
> valid variable name to write to.
>
> Error at Data Flow Task [SSIS.Pipeline]: "Row Count" failed validation
> and returned validation status "VS_ISBROKEN".
>
> Error at Data Flow Task [SSIS.Pipeline]: One or more component failed
> validation.
>
> Error at Data Flow Task: There were errors during task validation.
>
> (Microsoft.DataTransformationServices.VsIntegration)
>
> ------------------------------ BUTTONS:
>
> OK
> ------------------------------
I have tried following this suggested solution but with the same results:
SSIS Row Count: Getting a null variable error where there is clearly a selected variable
Can someone please tell me what this error message means and what I can do to fix it?
Thank you.
That seems to indicate that the Rowcount component doesn't have a package variable set, to which to write the result of its Count. Double-click on this component and set the variable. Watch out that SSIS variable names are case-sensitive.
You can have a valid-looking variable name in the Rowcount box, which in fact no longer exists in the package. So click on the drop-down, even if a variable name is there, to check that it's actually an existing package variable.

Run Stored Procedure in Airflow

I try to run my stored procedure in Airflow. Simply, I imported mssql operator and tried to execute following:
sql_command = """ EXEC [spAirflowTest] """
t3 = MsSqlOperator( task_id = 'run_test_proc',
mssql_conn_id = 'FIConnection',
sql = sql_command,
dag = dag,
database = 'RDW')
It completes this task as successful. However, task is not even executed. Because I get no error from system, I also cannot identify the error. To identify whether it arrived to my microsoft sql server, I checked with data profiling and it seems like server gets the command but does not execute it. Indeed, I can see sql command in data profiling tool.
When I run command for reading something, like :
select *
from sys.tables
it returns successful, also, with result. How can I solve this problem? Is there anyone who encountered with this issue?
sql_command = """ EXEC [spAirflowTest] """
t3 = MsSqlOperator( task_id = 'run_test_proc',
mssql_conn_id = 'FIConnection',
sql = sql_command,
dag = dag,
database = 'RDW',
autocommit = True)
adding autocommit as above solved the issue

How to write a simple stored procedure in advantage data architect

I am creating a WPF application using Advantage database server. I want to insert some data using stored procedure
Any sample code ?
I tried two input parameter TestID and TestName (both NCHAR)
INSERT INTO TestTable(
Test_Id,
Test_Name)
VALUES (
#TestID,
#TestName);
But show error like
Error 7200: AQE Error: State = HY000; NativeError = 5154;
[SAP][Advantage SQL Engine][ASA] Error 5154: Execution of the stored
procedure failed. Procedure Name: TestInsert. Error 7200: AQE
Error: State = S0000; NativeError = 2121; [SAP][Advantage SQL
Engine]Column not found: #TestID -- Location of error in the SQL
statement is: 42 (line: 3 column: 5) Error in stored procedure:
TestInsert AdsCommand query execution failed.
I am new in SAP ADS. Please help me.
use _XXXX notation for input parameters.
ie,
INSERT INTO TestTable( Test_Id, Test_Name)
VALUES ( _#TestID, _#TestName);

DataStage gives error using partitioned reads to Netezza

Very often we are unable to use Partitioned reads in Netezza connector.
Example
When partitioned read = Yes and Generated SQL at Runtime = Yes this works:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
When Generated SQL at Runtime = No and the query is Autogenerated by DataStage (or we write it our selves) the query looks like this:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
WHERE mod(datasliceid,[[node-count]])=[[node-number]]
It will then throw an error:
DB_TI_FT_Salg: Unexpected ODBC error occurred. Reason: [SQLCODE=42000][Native=27] ERROR: 'SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr" FROM dwhusr."TI_FT_Salg" where mod(datasliceid,[[node-count]])=[[node-number]] limit 0'
error ^ found "[" (at char 102) expecting an identifier found a keyword (CC_NZMetadataHelper::describeResultSet, file CC_NZMetadataHelper.cpp, line 5 622)
Please help!

Resources