Getting 10,000 rows of SQL code into SSRS

  • jeffshelix

    SSCrazy

    Points: 2251

    I wrote 10,000 lines of SQL (several temp tables) and i would like to move it to SSRS but i  can't copy and paste that much code.  Thoughts?

    thanks

  • Thom A

    SSC Guru

    Points: 98657

    Use an SP. Putting the SQL directly in SSRS is rarely a good idea.

    Also, however, I doubt that using several temporary tables is going to be the best (performing) solution.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.

  • Jeff Moden

    SSC Guru

    Points: 996863

    jeffshelix - Wednesday, April 25, 2018 7:48 AM

    I wrote 10,000 lines of SQL (several temp tables) and i would like to move it to SSRS but i  can't copy and paste that much code.  Thoughts?

    thanks

    Convert it to a stored procedure and call the stored procedure from SSRS.

    --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".
    "If "pre-optimization" is the root of all evil, then what does the resulting no optimization lead to?"

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

  • jeffshelix

    SSCrazy

    Points: 2251

    Thom A - i totally agree that my large temp table isnt good code, but i need Duty Rates from Customs and that table is 9500 rows long.  My company doesnt have a Table that holds them  . . . yet

    THanks

    Jeff

  • jonathan.crawford

    SSCertifiable

    Points: 6581

    Put your code into a stored procedure, execute your SSRS report using a stored procedure.

    -------------------------------------------------------------------------------------------------------------------------------------
    Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses

Viewing 5 posts - 1 through 5 (of 5 total)

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