Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

exec ssis package as from SP throws error "peer connection closed prematurely" but works when run as job or manually

$
0
0

Hi,

I have a SSIS package which has OLEDB connection to tabular model query and dumps the data into table and transforms the data for business needs.There are package parameters .I ran the package as a SQL job and in VS ,it works fine.But when i execute this as a SP ,i get very strange error like "the peer closed connection prematurely".This is the connection that points to tabular model.

What could be causing this and what needs to be changed.Below is the script:

/****** Object:  StoredProcedure   Script Date: 6/29/2020 23:12:41 ******/

create proc [dbo].[RefreshOnDemand](@Yrmonth nvarchar(100),@RefreshedBy nvarchar(100)) as

declare @my_execution_id bigint

declare @my_folder_name varchar(255)= 'Inventory'
declare @my_project_name varchar(255) = 'Inventory'
declare @my_package_name varchar(255) = 'RefreshData.dtsx'
declare @StartDate nvarchar(100),@EndDate nvarchar(100)

set @StartDate=(select concat(@Yrmonth , '-01' ,'T00:00:00' ))
set @EndDate=(select concat( EOMONTH(@StartDate),'T00:00:00'))


--First create Execution and get ExecutionID in a variable

exec [SSISDB].[catalog].[create_execution]
@folder_name = @my_folder_name
,@project_name = @my_project_name
,@package_name = @my_package_name
,@reference_id = null
,@execution_id = @my_execution_id output


--Wait until package execution is done
EXEC [SSISDB].[catalog].set_execution_parameter_value
@my_execution_id,  
@object_type=50, 
@parameter_name=N'SYNCHRONIZED', 
@parameter_value=1

--Set package parameters
exec [SSISDB].[catalog].set_execution_parameter_value  @my_execution_id, 30, 'Month_to_delete', @Yrmonth  
exec [SSISDB].[catalog].set_execution_parameter_value  @my_execution_id, 30, 'Scheduled_StartDate', @StartDate 
exec [SSISDB].[catalog].set_execution_parameter_value  @my_execution_id, 30, 'Scheduled_EndDate', @EndDate
exec [SSISDB].[catalog].set_execution_parameter_value  @my_execution_id, 30, 'WhoTrigerred', @RefreshedBy

--Start Execution
exec [SSISDB].[catalog].start_execution @my_execution_id

-- Check package status, and fail script if the package failed
IF 7 <> (SELECT [status] FROM [SSISDB].[catalog].[executions] WHERE execution_id = @my_execution_id)
RAISERROR('The package failed. Check the SSIS catalog logs for more information', 16, 1)


Visual Studio 2015 For SSIS - Script Task popping number of errors relevant to assembly

$
0
0

Hello Everyone,

We have recently installed VS 2015 for SSIS development, But unfortunately when I open new Integration Project and add any script task to dtsx package and try to build the edit script (Visual Basic 2015 )task component it gives number of  .net relevant errors as below, Please help asap.

1- 

SeverityCodeDescriptionProjectFileLine
ErrorSystem.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.ST_c072a6debe1c45e9b9f68a71619b1128C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets56

2- 

SeverityCodeDescriptionProjectFileLine
ErrorFile name: 'System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.ST_c072a6debe1c45e9b9f68a71619b1128C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets56

3- 

SeverityCodeDescriptionProjectFileLine
Errorat System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)ST_c072a6debe1c45e9b9f68a71619b1128C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets56

4- 

SeverityCodeDescriptionProjectFileLine
Errorat Microsoft.CodeAnalysis.CommandLine.DesktopBuildClient.RunServerCompilationCore(RequestLanguage language, List`1 arguments, BuildPaths buildPaths, String pipeName, String keepAlive, String libEnvVariable, Nullable`1 timeoutOverride, Func`3 tryCreateServerFunc, CancellationToken cancellationToken)ST_c072a6debe1c45e9b9f68a71619b1128C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.Core.targets56

and lot many slimier issues , any help would be greatly appropriated.

Thanks, Shankar


New Thread has arrived

Lookup Task With Dynamic Schema/Library Name Change to access DB2 Tables for DEV and QA

$
0
0

Hi,

Below are the details is the Issue i am facing:

I have a Data flow task(DFT) that has a SQL server source and a DB2 destination.

The DFT has a lookup task against the destination table in DB2.

I have a few tables in "Test" Library that i access using "Test"."DestinationTable". I use this while developing. When i move it to QA, I will have to access the "QA" library using "QA"."DestinationTable".

I am using a AS400 DB2 connection manager that links to a particular Library in the DB2 environment. (But i am able to access other tables in other libraries as well using the same connection manager. Permission is not a issue). This helps populate the Dropdown with the tables in the Schema i mention in the config file.

When moving the file to QA environment, i change the Schema name in the config file. This makes the Connection manager to point to the QA library, but the look up task still refers the Test library and i have to manually change the table from the dropdown with the newly populated tables from QA.

the Issue is--> i do not want to change the table manually from the dropdown in the lookup task on moving to QA.

I have resolved this issue in OLD DB destination using a table name from Variable. I have also resolved the Issue in the script task by using a variable for the Library name. But i am the above solutions do not work for the Lookup task. Kindly help me on this.

Regards,

Finny

Delete files older than a month using C# in SSIS

$
0
0

Delete the files in a specific folder older than a months using SSIS Script Task (C#).

Folder has files with different name.

Just based upon the creation time files should be deleted.


transfer files from sharepoint site to blob storage

$
0
0

Hi,

I am working on to create an SSIS package to transfer files from a sharepoint site to BLOB storage.

Can you please provide steps on how to achieve this?

Thanks much in advance!


harshac

SSIS - Contious row count in a ForEach Loop

$
0
0

Hi there

I currently have a solution that loops through a series of files, transforms and consolidates the data into a single CSV.

As part of this function, I have a row count which is outputted on the latter. This solution now needs an enhancement so that the row count becomes continuous, and I'm not 100% sure how to achieve this.

As an example, the current behaviour: -

File/Row | Rowcount 

File1 Row1 | 1

File1 Row2 | 2

File1 Row3 | 3

File2 Row1 | 1

File2 Row2 | 2

Flle3 Row1 | 1

This is currently achieved with a 'Script Task' in the Data Flow Task of the For Each Loop Container..

But what I want to achieve is...

File/Row | Rowcount 

File1 Row1 | 1

File1 Row2 | 2

File1 Row3 | 3

File2 Row1 | 4

File2 Row2 | 5

Flle3 Row1 | 6

… and I'm not entirely sure how I achieve it, so any help would be much appreciated?

Thanks,

Michael

SSIS - Continuous row count in a ForEach Loop

$
0
0

Hi there

I currently have a solution that loops through a series of files, transforms and consolidates the data into a single CSV.

As part of this function, I have a row count which is outputted on the latter. This solution now needs an enhancement so that the row count becomes continuous, and I'm not 100% sure how to achieve this.

As an example, the current behaviour: -

File/Row | Rowcount 

File1 Row1 | 1

File1 Row2 | 2

File1 Row3 | 3

File2 Row1 | 1

File2 Row2 | 2

Flle3 Row1 | 1

This is currently achieved with a 'Script Task' in the Data Flow Task of the For Each Loop Container..

But what I want to achieve is...

File/Row | Rowcount 

File1 Row1 | 1

File1 Row2 | 2

File1 Row3 | 3

File2 Row1 | 4

File2 Row2 | 5

Flle3 Row1 | 6

… and I'm not entirely sure how I achieve it, so any help would be much appreciated?

Thanks,

Michael



Dax Query as a variable with parameters

$
0
0

Hi,

I have an OLE db source currently with SQL command as source .I want to pass parameters to this query to filter the data and load into table.Is it not possible to have variable as source for the DAX query ? Asking this because the query that works in DAX studio is returning errors.

I am trying to do this :

  • OLE db source with "sql command from variable" as data access mode.Variable as string type.
  • StartDate and EndDate are parameters of datetime type
  • Below query returns query parsing errors.I tried to enclose parameters as "@[$Package::StartDate] " ,"+@[$Package::StartDate] +".None of these work.Hence, i have the question if we can use parameters in the DAX query as a variable in SSIS.I have used MDX with parameters but would like to know if DAX allows it as well.Pls guide
  • "EVALUATE
    SUMMARIZECOLUMNS (
        'Sales'[SONUM],
        'SAles'[SOLINE],
             FILTER (
            'Sales',
            [SONUM] <> BLANK ()
                && [SHIP_DATE]
                    >= @[$Package::StartDate] 
                && [SHIP_DATE] <= @[$Package::EndDate] 
        ),
        "OrderCount", [Count of Orders]
    )" 

SSIS OLE DB source component fails with DAX query after upgrading to SSAS 14 (2017)

$
0
0

Hi, 

I have weird situation where SSIS  OLE DB Source component fails with DAX query while I want to connect to upgraded SSAS 2017 Instance. However when I connect to the SSAS 2016 (old) instance everything works fine. 

Error what I get while running SSIS package is following: "Error: The expression for variable "DAXquery" failed evaluation. There was an error in the expression."

While trying to parse query in package following "helpful" error appears: "OLE DB error: OLE DB or ODBC error: An unexpected exception occurred."

I created new project to eliminate possible corrupted project instability and figured out that it depends on the DAX query itself, if it gets parse error in SSAS 2017 connector or not (see query examples below).

However both queries work fine in DAX studio connecting SSAS 2017 and 2016 and in SSIS package if connecting to SSAS 2016. If I try to connect in SSIS package to SSAS 2017 , longer query gets parse error...

Any Ideas what might create different behavior in DAX syntax depending on SSAS version?

Simple query - no error___________________________________________________________
EVALUATE  SUMMARIZE('Dim Kuupäev', 'Dim Kuupäev'[KuuAasta])

Query with some filters - gets error in SSAS 2017___________________________________________________

     

DEFINE VAR __DS0FilterTable = 
  FILTER(
    KEEPFILTERS(VALUES('Dim Kuupäev'[Kuupäev])),
    AND(
      'Dim Kuupäev'[Kuupäev] >= DATE(2016, 9, 1),
      'Dim Kuupäev'[Kuupäev] < DATE(2018, 6, 21)
    )
  )
   VAR __DS0FilterTable2 = 
    FILTER(
      KEEPFILTERS(VALUES('Dim Kaubadimensioon'[Kaubadimensioon konfiguratsioon])),
      'Dim Kaubadimensioon'[Kaubadimensioon konfiguratsioon] = "-"
    )

  VAR __DS0FilterTable3 = 
    FILTER(
      KEEPFILTERS(VALUES('Dim Ladu'[Lao kood])),
      NOT(
        OR(
          OR(
            OR(
              OR('Dim Ladu'[Lao kood] = "11", 'Dim Ladu'[Lao kood] = "15"),
              'Dim Ladu'[Lao kood] = "94"
            ),
            'Dim Ladu'[Lao kood] = "95"
          ),
          'Dim Ladu'[Lao kood] = "99"
        )
      )
    )

  VAR __DS0FilterTable4 = 
    FILTER(
      KEEPFILTERS(VALUES('Dim Kaup'[Kauba konteerimisreegel])),
      OR(
        OR(
          OR(
            OR(
              OR(
                OR(
                  'Dim Kaup'[Kauba konteerimisreegel] = "CON",
                  'Dim Kaup'[Kauba konteerimisreegel] = "ELE"
                ),
                'Dim Kaup'[Kauba konteerimisreegel] = "GAR"
              ),
              'Dim Kaup'[Kauba konteerimisreegel] = "HOM"
            ),
            'Dim Kaup'[Kauba konteerimisreegel] = "INT"
          ),
          'Dim Kaup'[Kauba konteerimisreegel] = "MET"
        ),
        'Dim Kaup'[Kauba konteerimisreegel] = "SAN"
      )
    )

EVALUATE

    SUMMARIZECOLUMNS(

       'Dim Kuupäev'[Kuupäev], 'Dim Ladu'[Lao kood], 'Dim Kaup'[Kaubakood]
      ,
      __DS0FilterTable,
          __DS0FilterTable2,
          __DS0FilterTable3,
          __DS0FilterTable4,      

      "Füüsiline_laokogus", 'Fakt Laoseis'[Füüsiline laokogus]
    )

Regards, 

Fred

OPENXML: How to perform CRUD operation using OpenXML

$
0
0

looking for some good example to perform CRUD operation using OpenXML.

thanks

OpenXML and depth issue

$
0
0

i was reading a write up on openxml from here https://docs.microsoft.com/en-us/sql/relational-databases/xml/examples-using-openxml?view=sql-server-ver15

but one thing confused me.

see this example code

DECLARE @XmlDocumentHandle int  
DECLARE @XmlDocument nvarchar(1000)  
SET @XmlDocument = N'<ROOT>  <Customer CustomerID="VINET" ContactName="Paul Henriot">  <Order OrderID="10248" CustomerID="VINET" EmployeeID="5"   
           OrderDate="1996-07-04T00:00:00">  <OrderDetail ProductID="11" Quantity="12"/>  <OrderDetail ProductID="42" Quantity="10"/>  </Order>  </Customer>  <Customer CustomerID="LILAS" ContactName="Carlos Gonzlez">  <Order OrderID="10283" CustomerID="LILAS" EmployeeID="3"   
           OrderDate="1996-08-16T00:00:00">  <OrderDetail ProductID="72" Quantity="3"/>  </Order>  </Customer>  </ROOT>'  
-- Create an internal representation of the XML document.  
EXEC sp_xml_preparedocument @XmlDocumentHandle OUTPUT, @XmlDocument  
-- Execute a SELECT stmt using OPENXML rowset provider.  
SELECT *  
FROM OPENXML (@XmlDocumentHandle, '/ROOT/Customer/Order/OrderDetail',2)  
WITH (OrderID     int         '../@OrderID',  
      CustomerID  varchar(10) '../@CustomerID',  
      OrderDate   datetime    '../@OrderDate',  
      ProdID      int         '@ProductID',  
      Qty         int         '@Quantity')  
EXEC sp_xml_removedocument @XmlDocumentHandle  

This line confuse me FROM OPENXML (@XmlDocumentHandle, '/ROOT/Customer/Order/OrderDetail',2)

here they pass 2 but i think it should be 4. there root then customer then order and then orderdetail...so total 4

so how it can be 2 rather it should be 4.

please tell me why they wrote 2 instead of 4 ?

please discuss this. thanks

Script Task Strange Issue - Please help!

$
0
0

Hi,

I have a script task to read the filename from a folder (which has lot of files) and sort the files and process it. First in First out

The sample file name in the folder is  'Q_Employee_FIN_for_Contractors_20200628200008.txt' and only the datatime changes for each and every file. The 'Q_Employee_FIN_for_Contractors_' part remains same.

In the script task, if i give  like '*.txt' , then the task correctly takes all the files and it works great. But, If I give like 'Q_Employee_FIN_for_Contractors_*.txt'  or Q_*.txt , I am getting 'Exception thrown by the target invocation' error. I am confused. Can you please help me on this?  Below is the code for ref

public void Main()
        {
            // Create a dataset. I named it unsorted, because it's not yet sorted 
            DataSet dsUnsorted = new DataSet();
            // Create a new table in the dataset 
            DataTable filelistTable = dsUnsorted.Tables.Add();
            filelistTable.Columns.Add("FilePath", typeof(string)); // Filepath needed for connectionstring. 
            filelistTable.Columns.Add("FileName", typeof(string)); // Filename used for sorting [optional]. 
            filelistTable.Columns.Add("FileDate", typeof(DateTime));// Filedate used for sorting [optional]. 
            // Get all files within the folder 
            string[] allFiles = Directory.GetFiles(Dts.Variables["User::EmployeeFilePath"].Value.ToString());
            // Variable for storing file properties 
            FileInfo fileInfo;
            // Loop through the files in the folder 
            foreach (string currentFile in allFiles)
            {
                // Fill fileInfo variable with file information 
                fileInfo = new FileInfo(currentFile);
                // Choose which the file properties you will use 
                // Columns: FilePath FileName FileDate 
                filelistTable.Rows.Add(fileInfo.FullName, fileInfo.Name, fileInfo.CreationTime);
            }
            // Filtering on *.txt extension. Note: like uses * instead of % 
            // Sorting the files on filename (or filedate: FileName DESC) 
            // DataRow[] rows = dsUnsorted.Tables[0].Select("FileName like '*.txt'", "FileName ASC");     ---working version
               DataRow[] rows = dsUnsorted.Tables[0].Select("FileName like 'Q_*.txt'", "FileName ASC");  ----Not working
            // Create a new sorted dataset that the SSIS foreach loop uses. 
            DataSet dsSorted = new DataSet();
            DataTable filelistTableSorted = dsSorted.Tables.Add();
            // Only interested in the filepath which is needed for the connectionstring 
            filelistTableSorted.Columns.Add("FilePath", typeof(string));
            // Fill the new dataset with the sorted rows. 
            foreach (DataRow row in rows)
            {
                filelistTableSorted.Rows.Add(row["FilePath"].ToString());
            }
            // Store the dataset in the SSIS variable 
            Dts.Variables["dataset"].Value = dsSorted;
            Dts.TaskResult = (int)ScriptResults.Success;

        }

SSIS - OLE DB Query Editor Date Issue

$
0
0

I am new to SSIS and still finding my way around.

Currently I am using SSIS to do a bulk insert from an AS400 table using OLE DB.  The table I am pulling from returns 1.5 million records so I want to modify the package to filter down the number of records in order to speed it up.  I went into OLE DB Source Editor and changed the Data access mode from Table or view to SQL command.   

The AS400 source table has a Create Date Field (CRDT) and is a numeric format YYYYMMDD.  The simplified SQL Command is below.

SELECT. FIELD1, FIELD2, FIELD3, CRDT

FROM   CATALOG.TABLE1

WHERE FIELD1 = 90 and CRDT >= 20200703

I am trying to have the CRDT value to be 3 months prior to whatever the current date is when the package is run which would reduce the number of records returned to be around 50K.

I have no problem doing this in TSQL BUT SSIS seems to be a different animal.

Help!

Thank you in advance.

SSIS Packages won't run as jobs - "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."

$
0
0

We are having error with running SSIS Packages as Jobs.  I've been searching forums for 2 days w/o any luck.  The SSIS package runs w/o issue when testing in BIDS but when trying to convert to a SQL Job it will not run, the error listed below.

Environment: Server 2008 R2, SQL 2008 R2

SQL Config: Tried both running all services as System and with a local user with Admin Rights to the box, similar errors, slightly different.

Also did try using a Proxy Acct (same as local admin) with no luck.

Both Users; System & Local Admin Acct are setup in SQL with SysAdmin Role.

Running as Local Admin User:

Date  3/15/2012 12:18:43 PM
Log  Job History (SQLCMDB_Mail_Plan_Export_To_Oracle)

Step ID  1
Server  <redacted>
Job Name  SQLCMDB_Mail_Plan_Export_To_Oracle
Step Name  SQLCMDB_Mail_Plan_Export_To_Oracle
Duration  00:00:02
Sql Severity  0
Sql Message ID  0
Operator Emailed  
Operator Net sent  
Operator Paged  
Retries Attempted  0

Message
Executed as user: <redacted>.
Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0 for 64-bit  Copyright (C) Microsoft Corporation 2010.
All rights reserved.   
Started:  12:18:43 PM 
Error: 2012-03-15 12:18:45.03     Code: 0xC0202009     Source: SQLCMDB_Mail_Plan_Export_To_Oracle Connection manager "<redacted>"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.".  End Error  Error: 2012-03-15 12:18:45.03     Code: 0xC020801C     Source: Data Flow Task OLE DB Source [1802]     Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "<redacted>" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error: 2012-03-15 12:18:45.03     Code: 0xC0047017     Source: Data Flow Task SSIS.Pipeline     Description: component "OLE DB Source" (1802) failed validation and returned error code 0xC020801C.  End Error  Error: 2012-03-15 12:18:45.03     Code: 0xC004700C     Source: Data Flow Task SSIS.Pipeline     Description: One or more component failed validation.  End Error  Error: 2012-03-15 12:18:45.03     Code: 0xC0024107     Source: Data Flow Task      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:18:43 PM  Finished: 12:18:45 PM  Elapsed:  1.843 seconds.  The package execution failed.  The step failed.

Running as System:

Date  3/15/2012 1:13:45 PM
Log  Job History (SQLCMDB_Mail_Plan_Export_To_Oracle)

Step ID  1
Server  <redacted>
Job Name  SQLCMDB_Mail_Plan_Export_To_Oracle
Step Name  SQLCMDB_Mail_Plan_Export_To_Oracle
Duration  00:00:02
Sql Severity  0
Sql Message ID  0
Operator Emailed  
Operator Net sent  
Operator Paged  
Retries Attempted  0

Message
Executed as user: <redacted>\SYSTEM. Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  1:13:45 PM  Error: 2012-03-15 13:13:47.26     Code: 0xC0202009     Source: SQLCMDB_Mail_Plan_Export_To_Oracle Connection manager "<redacted>"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E4D.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E4D  Description: "Login failed for user '<AD>\<Computer Acct$>'.".  End Error  Error: 2012-03-15 13:13:47.26     Code: 0xC020801C     Source: Data Flow Task OLE DB Source [1802]     Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "<redacted>" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error: 2012-03-15 13:13:47.26     Code: 0xC0047017     Source: Data Flow Task SSIS.Pipeline     Description: component "OLE DB Source" (1802) failed validation and returned error code 0xC020801C.  End Error  Error: 2012-03-15 13:13:47.26     Code: 0xC004700C     Source: Data Flow Task SSIS.Pipeline     Description: One or more component failed validation.  End Error  Error: 2012-03-15 13:13:47.26     Code: 0xC0024107     Source: Data Flow Task      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  1:13:45 PM  Finished: 1:13:47 PM  Elapsed:  1.594 seconds.  The package execution failed.  The step failed.

SSIS: how Rollback for Oracle Db

$
0
0

hi all, I have an issue with my SSIS interface. I'd need to rollBack several insert made inside different dataflow. 

if one of the dataflow task fails all the other have to rollback. 

my try:

1 create a Execute SQL task with the statement "Begin, commit, rollback Transaction;"

error i got:

Error: 0xC002F210 at Begin, Execute SQL Task: Executing the query "BEGIN TRANSACTION;" failed with the following error: "ORA-06550: line 1, column 18:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   ( begin case declare end exception exit for goto if loop mod
   null pragma raise return select update while with
   <an identifier> <a double-quoted delimited-identifier>
   <a bind variable> << continue close current delete fetch lock
   insert open rollback savepoint set sql execute commit forall
   merge pipe purge". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

AND

2 i played with the transaction option at Sequence container level and at Dataflow level 

I have used Sequence container and set its Transaction Option property to Required.

And all containers in Sequence container are set to Supported, except for Truncate Execute Sql Task

Error i got

The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D00A "Unable to enlist in the transaction.".

PLEASE CAN ANYONE HELP WITH THIS 


SQL Server maintenance plan Failed to acquire connection “Local server connection”

$
0
0
I have an SQL server running on 11.0.5058.0.
I created a backup Maintenance Plan but I'm getting the following error:

Executed as user: MyDomain\dbaAcct. 
Microsoft (R) SQL Server Execute Package Utility  Version 11.0.5058.0 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:53:03 AM  Error: 2020-07-06 11:53:04.52     Code: 0xC00291EC    Source: {39010E7A-E7B3-462C-A418-5AD339537AC2} Execute SQL Task     Description: Failed to acquire connection "Local server connection". Connection may not be configured correctly or you may not have the right permissions on this connection.  End Error  Error: 2020-07-06 11:53:04.73     Code: 0xC0024104     Source: Back Up Database (Transaction Log)      Description: The Execute method on the task returned error code 0x80131501 (An exception occurred while executing a Transact-SQL statement or batch.). The Execute method must succeed, and indicate the result using an "out" parameter.  End Error  Error: 2020-07-06 11:53:04.73     Code: 0xC0024104    Source: {34EEAB12-81DB-4631-9850-2E01D2D2E0F6}      Description: The Execute method on the task returned error code 0x80131501 (An exception occurred while executing a Transact-SQL statement or batch.). The Execute method must succeed, and indicate the result using an "out" parameter.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  11:53:03 AM  Finished: 11:53:04 AM  Elapsed:  1.421 seconds.  The package execution failed.  The step failed.

I raised the Maximum error Count to 10 for the subplan (Sequence) and set the TransactionOption to required.

The SQL Server and Agent services are running on MyDomain\dbaAcct. I know not best practice, but trying to figure what's going on here.

When I go into Manage Connections and select Windows NT Security as I have on other servers I get an error saying that is couldn't find itself...

Lookup a sharepoint library for folder with dynamic name and load the excel file contained in folder

$
0
0

Hi,

What is the best way to look into the sharepoint library for folder whose name changes each month and load the excel file present in in into the SQL table

Scenario:

Folder in format yyyy-MM contains a file abc.xlsx.Each month a new folder is placed with the abc.xlsx.How can i iterate and lookup for the folder each month and extract the file inside it.

I am aware of the CSOM but would like to know how else it could be done using OData ??

SQL Server: Differential Maintenance Plan fails

$
0
0

I have created Backup Maintenance Plans for full, differential, and transaction logs.

I notice that the rest run without a hitch. The differential file is created, but get the following error:

Executed as user: MyDomain\dba_Acct. Started:  10:51:08 PM  Finished: 10:51:13 PM  Elapsed:  4.625 seconds.  The package execution failed.  The step failed.

The event log says the same.

When I set the maxerrorcount to 1 I get the following message:

Message
Executed as user: MyDomain\dba_Acct. ...  Version 11.0.5058.0 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:02:06 PM  Error: 2020-07-06 23:02:06.42     Code: 0xC0010018    Source: {1FD37D2C-E1A5-4BD9-98EB-9998742FED98}      Description: Failed to load task "{1FD37D2C-E1A5-4BD9-98EB-9998742FED98}", type "". The contact information for this task is "Maintenance Plan Reporting Task; Microsoft Corporation; Microsoft SQL Server v9; ? 2004 Microsoft Corporation; All Rights Reserved;http://www.microsoft.com/sql/support/default.asp;1".  End Error  Progress: 2020-07-06 23:02:06.55     Source: {9D1D47D8-A2C2-485A-8FC3-82888DF62128}     Executing query "DECLARE @Guid UNIQUEIDENTIFIER      EXECUTE msdb..sp...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:06.58     Source: Maintenance Cleanup Task 1      Executing query "EXECUTE master.dbo.xp_delete_file 0,N'\\MyBKServer\...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:06.69     Source: Back Up Database (Differential)      Executing query "EXECUTE master.dbo.xp_create_subdir N'\\MyBKServer\...".: 20% complete  End Progress  Progress: 2020-07-06 23:02:06.69     Source: Back Up Database (Differential)      Executing query "EXECUTE master.dbo.xp_create_subdir N'\\MyBKServer\...".: 40% complete  End Progress  Progress: 2020-07-06 23:02:06.69     Source: Back Up Database (Differential)      Executing query "EXECUTE master.dbo.xp_create_subdir N'\\MyBKServer\...".: 60% complete  End Progress  Progress: 2020-07-06 23:02:06.69     Source: Back Up Database (Differential)      Executing query "EXECUTE master.dbo.xp_create_subdir N'\\MyBKServer\...".: 80% complete  End Progress  Progress: 2020-07-06 23:02:06.70     Source: Back Up Database (Differential)      Executing query "EXECUTE master.dbo.xp_create_subdir N'\\MyBKServer\...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:07.24     Source: Back Up Database (Differential)      Executing query "BACKUP DATABASE [model] TO  DISK = N'\\MyBKServer\k...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:08.03    Source: Back Up Database (Differential)      Executing query "BACKUP DATABASE [msdb] TO  DISK = N'\\MyBKServer\k$...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:08.44     Source: Back Up Database (Differential)      Executing query "BACKUP DATABASE [ReportServer$DBINSTANCE] TO  DISK...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:08.78     Source: Back Up Database (Differential)      Executing query "BACKUP DATABASE [ReportServer$DBINSTANCETempDB] TO...".: 100% complete  End Progress  Progress: 2020-07-06 23:02:19.07     Source: Back Up Database (Differential)     Executing query "BACKUP DATABASE [MyDB] TO  DISK = N'\\MyBKServer\...".: 100% complete  End Progress  Error: 2020-07-06 23:02:19.07     Code: 0xC0010026     Source: {1FD37D2C-E1A5-4BD9-98EB-9998742FED98}     Description: The task has failed to load. The contact information for this task is "Maintenance Plan Reporting Task; Microsoft Corporation; Microsoft SQL Server v9; ? 2004 Microsoft Corporation; All Rights Reserved;http://www.microsoft.com/sql/support/default.asp;1".  End Error  Error: 2020-07-06 23:02:19.07     Code: 0xC0024107     Source: {1FD37D2C-E1A5-4BD9-98EB-9998742FED98}      Description: There were errors during task validation.  End Error  Warning: 2020-07-06 23:02:19.07     Code: 0x80019002     Source: OnPostExecute      Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (4) 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.  End Warning  Warning: 2020-07-06 23:02:19.07     Code: 0x80019002     Source: Backup      Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succe...  The package execution fa...  The step failed.

When I run sp_readerrorlog I get the following:

Database differential changes were backed up. Database: MyDB, creation date(time): 2016/03/15(16:07:04), pages dumped: 36908, first LSN: 3940:500656:237, last LSN: 3940:501192:1, full backup LSN: 3940:480544:286, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'\\MyBKServer\diff\backup_2020_07_06_230206_6942975.diff'}). This is an informational message. No user action is required.
BACKUP DATABASE WITH DIFFERENTIAL successfully processed 36794 pages in 9.986 seconds (28.785 MB/sec).

I have an SQL server running on 11.0.5058.0

Dimension Merge SCD - installation

$
0
0

Hi,

I came across an alternative component for SCD (slowly changing dimension) on Codeplex (https://archive.codeplex.com/?p=dimensionmergescd) however it has not been maintained for more than 10 years I guess.

Does anyone how to install this custom component as I didn't see any installation instructions or installer of some kind?

Also would this component be compatible with PostgresQL?

Roland

Invalid Object Name When Creating Nested View

$
0
0

Hello,

I'm using the Transfer SQL Server Objects Task in SSIS to migrate a set of table and views between servers.  This operation fails when creating a nested view.  One of the two views it is based upon has not been created on the target causing the script to fail with the following error:

"Invalid object name <vw_A>."

Does deferred name resolution not work for views?  Like stored procedures and other objects, names may not be resolved until runtime.  Is there a workaround?


Orlanzo
Viewing all 24688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>