Weird thing in SSIS

  • Hello there,

    I have a package that exports to a table when I debug and when i ran my package in SSIS it is fine.When I have the same package as a scheduled job it gives me less rows. Does anyone know what can i do to fix this?

    Much appreciate your help

    R

  • You haven't provided many details, but one thing to look at is the context that the package runs in. When you run it from Visual Studio, it runs as you. When it runs as a job, it runs as the SQL Server Agent service account. Could that explain the discrepancy?

    John

  • Sorry i didnt explain myself properly, :crying:

    My SSIS package is doing the following export (export wizard was used to create the SSIS package) some of these data to another table in another database. As I mentioned it runs fine under debugging and i get the number of rows expected inside the table. But when i have it as a job scheduled it gives less data exported to the table. Can it be the export wizard that I have used? I was thinking the account myself but i would think that it would have failed my job if it had permissions issues.

    Let me know if you need more detail.

  • You say you're exporting "some of these data", so not the whole table? What query are you using to filter it out? Is the destination database on the same server? If you run the query in SSMS, then, still in SSMS, use EXECUTE AS to run it as the SQL Server Agent account, do you get the same results both times?

    John

  • the query is this

    SELECT Number,

    CreatedDateTime,

    subject,

    convert(varchar(20), Incident.CreatedDateTime,103) as CreatedDate,

    FirstCallResolution

    FROM Table1

    WHERE CreatedDateTime >=

    CASE DATEPART(WEEKDAY,getDate())

    when 2 then dateadd(day,datediff(day,0,GetDate())-3,0) --mon

    when 3 then dateadd(day,datediff(day,0,GetDate())-4 ,0) --t

    when 4 then dateadd(day,datediff(day,0,GetDate())-5, 0) -- we

    when 5 then dateadd(day,datediff(day,0,GetDate())-6 ,0) -- thursday

    when 6 then dateadd(day,datediff(day,0,GetDate()),0)-- friday

    end And (Incident.Status<>'Closed')

    The account that this sql agent is running under is a sysadmin on the other sql server where i m getting the details from.

  • The other sql server? I'm confused. Please will you give a brief overview of what each task in the package does on what server? Also, did you try running the query as yourself and as the SQL Server Agent account and comparing the results?

    John

  • Hello there

    You helped me out thank you so much have seen the permissions and logged on as that account the language of that acount was different changed it to English and it is now working.

    THANK YOU

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply