SQL Code in a Query

  • I have used Views to setup the links to match data files that I want to pull data

    from. I have a large number of Views that I am consolidating into one Query that will

    run and create a table.

    What is the best way to execute this query automatically ?

    I tried to execute from the Management Sql Jobs but I got an error message saying the

    availble free space in the current job is limited to 3200.

    How do you execute large SQL programs ?

  • Create a stored procedure that does the required data manipulation, then assign the Job to run the stored procedure:

    "EXEC my_stored_proc [args]"

  • Thanks.

    I setup the stored procedure but I cannot find it when I try to setup link from Management Sever

    Agent Jobs

  • Not sure what you mean by "cannot find it"...What you want to do is go to the SQL Server Agent --> Jobs --> Right click the job you need --> Select Properties --> Go to "Steps" tab. If there is no step set up, add one by clicking "New", give it a name (like "Step 1", and type in the EXEC statement from my post above in the section labeled "Command", replacing the my_stored_proc with the name of your procedure. Holler if you need more help.

  • Thanks jpipes !!!!!!!!!!!

    That works great !!

    Rocko

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

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