I have a simple SQL export to an XLS file. To keep the file clean, I have powershell steps:
then runs a SQL step running a DTSX file that does a simple query and exports to the file.
when I run the DTSX file step it works fine, however after I run the two powershell steps it somehow permanently breaks the DTSX step, even if I run the job at that step only.
The only thing I can think of is I had to do set-location C: on the two powershell steps to have the code work, after i changed this the DTSX step constantly fails till I build it again, upload the new file, then it works until I run all three steps again. Any thoughts? I guess I could just build this in Visual Studio instead of using Powershell.
I tried to make the DTSX clear out the spreadsheet before it exports but that always failed, not sure if this is the way to go instead?
Step 1 (works every time): Set-Location c: Remove-Item -Path ""
Step 2 (works every time): Set-Location c: Copy-Item -Path "" -Destination ""
Step 3 (only works if I run it before ever trying the two above steps) Type: SQL Server Integrations Service Package Package Source: File system I made it using a simple Export Data task.
Error after running the powershell steps, when running the DTSX step:
Executed as user:. Microsoft (R) SQL Server Execute Package Utility Version 11.0.6260.1 for 32-bit Copyright (C) Microsoft Corporation. All rights reserved. Started: 12:00:05 AM Error: 2019-01-24 00:00:05.92 Code: 0xC0202009 Source: Data Flow Task 1 Destination - Query [32] Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37. End Error Error: 2019-01-24 00:00:05.92 Code: 0xC02020E8 Source: Data Flow Task 1 Destination - Query [32]
Description: Opening a rowset for "Query" failed. Check that the object exists in the database. End Error Error: 2019-01-24 00:00:06.00 Code: 0xC004706B Source: Data Flow Task 1 SSIS.Pipeline Description: "Destination - Query" failed validation and returned validation status "VS_ISBROKEN". End Error Error: 2019-01-24 00:00:06.00 Code: 0xC004700C Source: Data Flow Task 1 SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2019-01-24 00:00:06.00 Code: 0xC0024107 Source: Data Flow Task 1 Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 12:00:05 AM Finished: 12:00:06 AM Elapsed: 0.812 seconds. The package execution failed. The step failed.
User contributions licensed under CC BY-SA 3.0