Solved

SSIS 2012 package not working from SQL Server Agent job

Posted on 2014-11-13
15
489 Views
Last Modified: 2016-02-11
Hi,

We have created an SSIS package which reads csv files from shared path and processes it to dump data into SQL Server 2012. The package was initially developed in 2008 and upgraded to 2012 using SQL Server Data Tools, as our requirement required the packages to run from SQL Server 2012.

We scheduled the package as a sql server agent job and try to execute the job using proxy account. The proxy account has access to shared folder from where the csv files are read and has been given permission in the DB as well.  we encountered the below error -

Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  1:56:18 AM  Error: 2014-11-13 01:56:20.52     Code: 0xC0202020     Source: Data Flow Task Flat File Source [27]     Description: The buffer type is not valid. Make sure the Pipeline layout and all components pass validation.  End Error  Error: 2014-11-13 01:56:20.52     Code: 0xC004701A     Source: Data Flow Task SSIS.Pipeline     Description: Flat File Source failed the pre-execute phase and returned error code 0xC0202020.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  1:56:18 AM  Finished: 1:56:20 AM  Elapsed:  2.23 seconds.  The package execution failed.  The step failed.,00:00:02,0,0,,,,0



When we tried to run the another package that was developed using SSDT  also, it failed to execute.  On setting the
package to run in 32 bit mode in the execution options tab of the job step, it works. We need to execute this in 64 bit mode only.

If anybody has encountered this issue, kindly let us know how to resolve this. Any help is highly appreciated.

Thanks,
svapv
0
Comment
Question by:s vapv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 4
15 Comments
 
LVL 16

Expert Comment

by:DcpKing
ID: 40441632
Open the package in SSDT, go to the dataflow module involved, open the flat file connector. Get it to read the file and show you a correct preview - deliberately change the format to, say, fixed width and then back to the correct format and be sure that the data can be seen correctly. Reset the columns and save the task. Save the package and re-deploy it. It should now be a 64-bit 2012 package and should work.

hth

Mike
0
 

Author Comment

by:s vapv
ID: 40442271
Thanks very much for your response.

We tried out what you mentioned, bu it didn't work. Actually the problem seems to be with the script component, the InputBuffer Row returns NULL in 64 bit execution, If we execute in 32-bit, it is working.

Is there any solution to fix the script component issue that are migrated from 2008 to 2012?
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40444138
Could you post more info about the job?  For example, a screengrab of the SSIS control and data flows would help with context! Your error very clearly states that it is a Flat File source generating the problem, not a script task, which you didn't mention before.  

Are you building the package on a 32-bit machine and then trying to run it on a 64-bit machine, by any chance (you might get the wrong library code included).

One other question: is it actually absolutely necessary to run it in 64-bit mode? Some things just don't, like the Excel I/O !  It may be a lot easier for you just to accept this one as a 32-bit package.

hth

Mike
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 43

Expert Comment

by:Eugene Z
ID: 40444658
keep 32 bit execution and move on
0
 
LVL 43

Expert Comment

by:Eugene Z
ID: 40444668
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40445192
Eugene7: s vapv is not using Excel for import, but a flat file connector (see text of error message and his original statements). However, if he is having problems with a script task then he may be using some included code that is 32-bit-only ... hence my suggestion that he consider remaining as a 32-bit operation if possible.

hth,   s vapv,

Mike
0
 
LVL 43

Expert Comment

by:Eugene Z
ID: 40445668
yes, it is correct
32 bit is still SSIS friend
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40445956
"yes, it is correct
32 bit is still SSIS friend"

Looks like you were in a hurry there. Could you explain please?

thx, Mike
0
 
LVL 43

Expert Comment

by:Eugene Z
ID: 40446036
please, see the posted above links, even some for excel - but they are self explanatory, unless you are asking for some specifics that would need this SISS  be reviewed in a SSDT, check what sql server edition was used to develop this SSIS (64 -32 bit), what office tool, what sql service, pack, was it upgraded, etc.   Even maybe redesign starting by generation a New SSIS via Export\import..
as you know, EE has limits to see the requestor  screen and read mind.
If it is what you are asking.

Thx
0
 

Author Comment

by:s vapv
ID: 40446623
Thanks for all your suggestions.

Yes, it was developed in 32-bit and we are trying to migrate it to 64-bit. As mentioned, the script component is the one creating the problem. We are using flat file connector and not excel, but the flat file source is csv. I understand that there could be a problem with any of the underlying components that is used in the script, maybe any of it is using 32- bit still. The script component is called for errored out rows in the flat file.

The script component  has the below code

/* Microsoft SQL Server Integration Services Script Component
*  Write scripts using Microsoft Visual C# 2008.
*  ScriptMain is the entry point class of the script.*/

using System;
using System.Text;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    #region Constant Varibles
    StringBuilder sbExceptionMail= new StringBuilder();
    string strErrorDescription = string.Empty;
    string strFileName = string.Empty;
    #endregion
    public override void PreExecute()
    {
        base.PreExecute();
        /*
          Add your code here for preprocessing or remove if not needed
        */
    }

    public override void PostExecute()
    {
        base.PostExecute();
        /*
          Add your code here for postprocessing or remove if not needed
          You can set read/write variables here, for example:
          Variables.MyIntVar = 100
         
        */
        Variables.vExceptionLogErrorMail = sbExceptionMail.ToString();
        //MessageBox.Show(sbExceptionMail.ToString());

       
     
   
    }

    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
        Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode);
       strFileName=Row.FileType.ToString()+DateTime.Now.ToString("MMddyyyy");
       strErrorDescription = "The File " + strFileName + "Contains Following Error";
        sbExceptionMail.Append("<tr><td style='border: 1px solid black'>" + Row.FileType.ToString() + "</td><td style='border: 1px solid black'>" + DateTime.Now.ToString() + "</td><td style='border: 1px solid black'>"+strErrorDescription+"\n"+ Row.ErrorDescription.ToString() + "</td></tr>");
       
     
    }

}



Will try out your suggestions and keep you posted on the updates.

Thanks once again for your response.
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40447113
btw, is your development machine 64-bit or 32-bit?

Mike
0
 

Author Comment

by:s vapv
ID: 40447175
It's a 64-bit.

Thanks,
Svapv
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40448913
This may seem weird, but destroy the script task, complete the package without it, save it and close. Re-open and add the script task again - with a different name, and add the code again. Make the error message slightly different. Compile, save, and run the package. Then deploy and see if you still have the same problem. If so, consider seriously staying with 32bit for now.

hth

Mike
0
 

Accepted Solution

by:
s vapv earned 0 total points
ID: 40452084
Hi,

The package seems to be working from another 64-bit machine . Seems like some of the components in the current machine are 32-bit.

Thanks very much for your time and response.

Thanks,
svapv
0
 

Author Closing Comment

by:s vapv
ID: 40461726
worked after changing the machine
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A couple of weeks ago, my client requested me to implement a SSIS package that allows them to download their files from a FTP server and archives them. Microsoft SSIS is the powerful tool which allows us to proceed multiple files at same time even w…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question