• curious_sqldba (8/16/2013)


    I have a simple query, if i run that query from SSMS it takes about 10 mins and if i run the same query as a exec sql task inside SSIS package takes less than 3 mins? I am clearing the buffers after each execution, and yes the source connection strings are the same. I am logged in the server and testing using SSMS and SSIS. Is there any reason why it is faster from SSIS? Query returns about 20 million records

    SELECT * FROM vwActivities WHERE

    CreatedDateKey>=20130101 and Fde='A123'

    I guess I'd have to ask where you're putting the results for that query because I sure can't imagine returning 20 million rows to the screen... ever! I guess I'd also be curious why you're using an integer to represent a date/time unless the intent is to export to a file.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)