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

combine file name and data that contains in that file and load it into table using ssis

$
0
0

Dear All,

I have a case, and would you or somebody help me with this case.

background :

I have files with *.txt extension on a folder. the files name was contain store name.

example : 000001.txt in that folder it means stored number 000001.

beside that, this file contain some text inside it. that to define which one on that data was belong to, we need to define it by LENGTH.

example : 000001.txt file have this kind of data inside that files.

057577501B10Sereal 500gr118205000016000001000016000620    000000000000000000000000000000000000000000016000              00000000000                              0000000000000000000600000000012000000000000000000000000000                   0  

and this data, was delimit by LENGTH.

example :

length 1-9 was TransactionNo.

length 10-12 was TransactionType

length 13-24 was Product

etc

i have this table that contain StroreNo,TransactionNo,TypeTran,Product columns.

TO BE

i want to extract this data and load it into my table in database.

so the mapping will be like this :

FileName (from file name. exp: 000001) -> StoreNo

length 1-9 -> TransactionNo

length 10-12 -> TransactionType

length 13-24 -> Product

could some one give me a clue or tutorial how to do it?

any help i'll appreciate.

Best Regards,

Bambang


unzip password protected files - SSDS - .net 4.5

$
0
0

I have started using the dotnetzip ...

Downloaded it and in ssis script task referencing Ionic.ZIP.dll

in script, I am using using Ionic.ZIP and then in the main:

publicvoidMain(){string zipFullPath =Dts.Variables["User::FileNameFullPathZIP"].Value.ToString();string zipFullPath_Input =Dts.Variables["User::FileNamePathZIP_Input"].Value.ToString();string zipPassword =Dts.Variables["User::Password"].Value.ToString();// extract all files into using(var zip =ZipFile.Read(zipFullPath)){
                zip.Password= zipPassword;
                zip.ExtractAll(zipFullPath_Input);}Dts.TaskResult=(int)ScriptResults.Success;}

 but I get the following error:

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

how to pivot with SSIS

$
0
0

How to pivot the following example :

Send Email Task within For Each Loop container Expression builder error

$
0
0

Hi,

could somebody help in setting up Send Mail Task with regard to screenshot in attachment.Namely, according to Tutorial: https://msdn.microsoft.com/en-us/library/cc879316%28d=printer,v=sql.120%29.aspx

I have prepared what is visible in attachment but, it is not possible to evaluate expression forToLine property. What am I doing in wrong?

Two variables at beginning are for the tutorial purposes only while, variables belonging to actual project are three the later ones.

Thanks

How to deploy to SSIS 2012 from Visual Studio 2015

$
0
0

I have the latest SSDT BI for VS 2015, which clearly states "This release supports SQL Server 2016 through SQL Server 2005, and provides the design environment for adding features that are new in SQL Server 2016."

Is there anything specific I need to do to actually deploy from Visual Studio 2015 + SSDT BI into my SQL Server 2012?

When I try to deploy a package from Visual Studio, I get error:

Could not find stored procedure 'SSISDB.catalog.deploy_packages'. (Microsoft SQL Server, Error: 2812)

When I try from SSMS 2012 to "Import Packages..." my package fails with this message:

The package failed to load due to error 0xC0010014 "One or more error occurred. There should be more specific errors preceding this one that explains the details of the errors. This message is used as a return value from functions that encounter errors.". This occurs when CPackage::LoadFromXML fails.

In the xml report, the error message details say "<Message>Could not find stored procedure 'SSISDB.catalog.deploy_packages'.</Message>"

When I look at my DB Schema, indeed there is no such stored procedure.

So: How can I get my package deployed?

UPDATE: I tried deploying the project. This worked to get the project into MSSQL via Visual Studio 2015 "Deploy" menu item, however the project fails validation with error message: 

Error: Package migration from version 8 to version 6 failed with error 0xC001700A "The version number in the package is not valid. The version number cannot be greater than current version number.".

By the way, all these errors are coming from following the steps in SSIS Tutorial "Lesson 6: Using Parameters with the Project Deployment Model".

Thanks in advance!


Data flow with XML source succeeds, but imports nothing

$
0
0
I am trying to import an xml file that is 5.9MB using a data flow task with an XML file source.  It is going to an OLEDB destination and I have verified all of the mappings and I had the XML source create the schema for me.  When I execute the package it immediately goes to the data flow and shows that the package completed with success, but it does not import any rows. I have used this package with identical smaller files, but when I try with 5MB and larger is shows success, but does not import any of the data. Is there a file size limit possibly?

David Dye My Blog

SQL Server 2014 - How do I set up an SSIS job to run in 32 bit mode with SQL Server Agent?

$
0
0

I have an SSIS job that uses an ODBC connection to connect to a Postgres database.  I've read a couple different articles that say in order for me to run this as a scheduled job with SQL Server Agent that I need to set the job to run in 32 bit mode, but I can't figure out how.

I found some blogs about SQL Server 2008 that talk about selecting a checkbox on the 'new job step' tab, but I don't see that checkbox anywhere in SQL Server 2014.

Anyone know how to do this?

SSIS packages deployment error- The package failed to load due to error 0xC0011008 Error loading from XML

$
0
0

I am trying to deploy SSIS packages to file system using manifest file. These packages are upgraded from SSDT 2005 to SSDT 2010. Also I have changed the protection level from 'EncryptSensitiveWithPassword' to 'DontSaveSensitive' to upgrade it.

I coun't complete the deployment and the error details shown below.

TITLE: Package Installation Wizard

Package "Packagename.dtsx" could not be loaded. The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.

Package ""Packagename.dtsx" could not be loaded. The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.


ADDITIONAL INFORMATION:

The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.


The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.


BUTTONS:

OK

Please give a solution.


Sreekanth Mohan



SSIS Checkpoint restart second time after failure

$
0
0

Hi Experts,

I am working on checkpoints and had a question about the restart ability of the package from point of failure.

  1. My package has 5 Tasks running sequentially.
  2. Task 2 and Task 4 has SELECT 1/0 intentionally to test failure.
  3. Task 1, 3 and 5 is just SELECT 1

Below are the steps that I am testing.

  1. Run the package and it fails on Task 2 by creating a checkpoint file.
  2. Correct the Task 2 to SELECT 1
  3. Re-start the package (Uses checkpoint file)
  4. Runs from Task 2 and again fails on Task 4

Now here are my questions.

Does checkpoint work if I restart now after failing for the second time ? (Checkpoint file still there as package didn't complete successfully to delete the checkpoint file automatically.)

I tried this but it gives me an error

Error: Error loading value "<DTS:VariableValue xmlns:DTS="www.microsoft.com/SqlServer/Dts"/>" from node "DTS:VariableValue"

Any help is greatly appreciated.


SQL Killer



Passing variable value from child to parent package in SSIS 2012

$
0
0

Hi,

I am using Execute Package Task to run child package from parent package. Child package is capturing some value in a variable and i want to pass the value of this variable to parent package. How can i do this in SSIS 2012.

Thanks

SSIS - Error Code 0x80004005

$
0
0

I have searched through many forums concerning this error:

Error at Load Data Table Position Requisition [Load Data Table SFactor_PositionReqisition [1]]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred.  Error code: 0x80004005.

An OLE DB Record is available.  Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "Unspecified error."

An OLE DB record is available.  Source:  "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "Oracle error occurred, but error message coud not be retrieved from Oracle.".

An OlE DB record is available.  Source: "Microsfot OLE DB Provider for Oracle" Hresult: 0x80004005 Description: DataType is not supported.".

Error at Load Data Table Position Requisition [Load Data Table SFactor_PositionRequisition [1]]: Opening a rowset for "PHSF"."SFACTOR_POSITIONREQUISITION"" failed.  Check that the object exists in the database.

Additional information

|__> Exception from HRSULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

I am using SQL Server 2008 R2 (BIDS).

I think I get the issue as this only occurs on one of five table loads and this table is trying to take an NTEXT (Excel) data column and send it to a NCLOB Oracle (10g) data table.  This behavior was not experienced until I added the NCLOB column to the data table.  The data is required and setting the Oracle data column to VARCHAR2(2000) is not large enough to hold the data being imported. 

Is there a way to import the data to an NCLOB with this version of SSIS?  Maybe transform the data from NTEXT to TEXT to Varchar(Max)?  Any help and direction offered will be greatly appreciated.

Thank you.


MT

The PrimeOutput method on component "Excel Source - Position Requisition" (2245) returned error code 0xC02020C4.

$
0
0

Detail:

Bids 2008 R2 Enviornment for SSIS development

Excel Data export file source

Oracle 10g Data import destination

Local System:  8gb ram 64 bit Windows 7

Available Ram at time of Process Start:  4.17gb

Highest Ram utilized at time of Failure:  4.58gb (including starting amount)

The problem:  My excel data file contains 46,000 records but the SSIS data flow errors at approximately the 8571 record line during the data feed.  I do know that this error is solely based on a single column of data (dirty and wide).  This column is determined to be a DT_NTEXT and the longest row value for this is currently 3,989 characters.  This column's data comes from Excel through the Advanced Editor to DT_NTEXT. 

The error I receive within the Excel Source Component is: 

The status of the Error Flow at the point of the error is:

An additional error (Truncation)  is encountered at the Data Conversion (I check for NULLs and handle).  I have reviewed the records around where the indication is the error row is but cannot find the truncation which is being reported.  I don't necessarily believe this error real at this time.  Again, this must be the newly added column as the package is 100% successful with the same data when this new column is not included.

7,538 records are loaded into the database

57 records are sent to the Error Output (I will review later)

My question is what can I do to get the data feed to load?  Are there settings within the package which may need to be set in order to better handle the situation?  Something else?

I appreciate any thoughts which will be put forward.

Thank you.


MT

SSIS package with OData connection - can't connect

$
0
0

I need to read some data from a SP list. I have the OData connection manager setup. When I test the connection to my sharepoint site, it says it's successful. I added in a data flow task and then an OData Source. In the OData Source editor, I select the Odata connection manager. I want to use a collection. However, it says "Unable to load collection for the connection Odata Source, reason: Cannot open this connection"


Anybody know how to resolve this?


Variables set in a script task not being applied in a scheduled run

$
0
0

I'm running an SSIS job where I set a table variable in a script task early in the control flow.

When I run it locally on my machine, it works fine.

But when I run it as a scheduled job via SQL Server Agent, the variable isn't using the value from the script, instead it's using the default value from the variable definition window.

Do I need to do something special to get my variables to actually take their values from a script task when the jobs are running on the server?

OLE DB Source only selects first row

$
0
0

Hi there,

I originally setup my SSIS project to use ADO.NET data sources, which worked without issues and returned all rows correctly. I've now converted the data sources for each data flow to use an OLE DB source (Sybase 9) with the same queries, modified to use parameters for dates. The queries are returning the same rows as the ADO.NET source when I manually run them through Sybase's SQL Anywhere, so I've confirmed it's not an issue with the updated queries. When the query is run in SSIS with an OLE DB source, it only returns the top row.

I noticed it works if I create a new data flow and copy/paste the tasks from the old flow to the new one. Unfortunately, that doesn't seem to always fix it (and is painful to go through).

Has anyone run in to this issue before?

Thanks,

- Marc


SSIS package to run Powershell command ?

$
0
0

I have a powershell script, how can I have SSIS task (package ) to run this powershell script ?

how can I acheive this ?


MBH

How to connect to SQL Server Express via ODBC

$
0
0

I have installed SQL Server Express on my computer. I wish to connect to its tables via ODBC. When I opened ODBC, I was surprised to find that there was no connector for SQL Server Express. How do I connect?

Thanks.

SSIS 2012 : Package hangs intermittently during execution (OnPipelinePreComponentCall)

$
0
0

Hi,

I'm facing a strange problem wherein package execution hangs intermittently on state "OnPipelinePreComponentCall".

If the execution process is killed & restarted, it executes properly & completes successfully.

Package design is as below -

1. SSIS 2012 package in package deployment mode.

2. Pulls data from DB2 & loads it into SQL 2008 SP2 as is after appropriate data type conversions

3. Package contains grandparent (1)-parent (1)-child (21) relationship. 21 child packages have been divided into 4 sequence containers. Each container executes one after other (no parallel processing)

4. Package is executed using DtExec 32 bit utility.

Steps taken so far -

1. DelayValidation property is set to True for all data flow & connection managers

2. No trace on database, so its not waiting on database.

I'm still investigating the issue but kindly guide on areas to explore further to identify the root cause.

Unzip, Load the data and store the file name into column, move into another directory as zip file

$
0
0

Dear All,

can anyone help me. i'm trying to solved this task but it seems, my knowledge was not enough.

background :

I have directory, lets say Directory A_17022016, that contains many zip files, with format MMddyyyy_Tran.zip. each zip files, contains files.

Example:

Directory A_17022016

> 01022016_Tran.Zip

   >A_1.text

   >B_2.text

   >C_3.text

>02022016_Tran.Zip

   >A_1.text

   >B_2.text

   >C_3.text

...

>17022016_Tran.Zip

   >A_1.text

   >B_2.text

   >C_3.text

so, every zip files, contains the same files. i'have tried to using for each loop container and using task script from this reference:

 https://www.youtube.com/watch?v=juaP-wyu5Yk

but it can not handles, if more than 1 zip file which contains, the same files format.

TO BE:

here is my goal.

1. Unzip the files and put the files into directory. with MMddyyyy as directory format.

Example:

unzip all the zip files on Directory A_17022016, so the hierarchy will be

Directory A_17022016

> > directory 01022016_Tran

> > directory 02022016_Tran

...

> > directory 17022016_Tran

each of the sub directory contains files, that have been rename into *.txt, so the hierarchy will be like

Directory A_17022016

> > directory 01022016_Tran

>>>>>A_1.txt

>>>>>B_2.txt

>>>>>C_3.txt

> > directory 02022016_Tran

>>>>>A_1.txt

>>>>>B_2.txt

>>>>>C_3.txt

...

> > directory 17022016_Tran

>>>>>A_1.txt

>>>>>B_2.txt

>>>>>C_3.txt

and when I store the data, the name of the files, such as A_1,B_2,C_3 will be load and stored in table.

does any one could help me solved this problems?

i'll appreciate it. thank you.

Best Regards,

Bambang

 

Date conversion from YYYY-MM-DD

$
0
0

Hi all

i am trying to convert the date field from YYYY-MM-DD to DD-MMM-YYYY in SSIS

however for testing purpose i have tried to check in SQL serverit's working perfectly

SELECT REPLACE(REPLACE(CONVERT(nvarchar(100), EFFDT, 106),' ','-'),',', '')
from [dbo].[Action_Reason]

output

dd-mmm-yyyy

but when i tried to include the logic using the derived column it is not accepting 

TITLE: Microsoft Visual Studio
------------------------------

Error at Data Flow Task [Derived Column [1381]]: The function "nvarchar" was not recognized. Either the function name is incorrect or does not exist.

Error at Data Flow Task [Derived Column [1381]]: Attempt to parse the expression "REPLACE(REPLACE(CONVERT(nvarchar(100), EFFDT, 106),' ','-'),',', '')" failed and returned error code 0xC004708A. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

Error at Data Flow Task [Derived Column [1381]]: Cannot parse the expression "REPLACE(REPLACE(CONVERT(nvarchar(100), EFFDT, 106),' ','-'),',', '')". The expression was not valid, or there is an out-of-memory error.

Error at Data Flow Task [Derived Column [1381]]: The expression "REPLACE(REPLACE(CONVERT(nvarchar(100), EFFDT, 106),' ','-'),',', '')" on "Derived Column.Inputs[Derived Column Input].Columns[EFFDT]" is not valid.


Error at Data Flow Task [Derived Column [1381]]: Failed to set property "Expression" on "Derived Column.Inputs[Derived Column Input].Columns[EFFDT]".



------------------------------
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------
BUTTONS:

OK
------------------------------

how to resolve this error.

Viewing all 24688 articles
Browse latest View live


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