Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2014
    Posts
    268
    Provided Answers: 6

    Unanswered: Thoughts on consolidating multiple queries into one table (function or SP)

    I was messing around with stored procedures and I was wondering if creating a SP that populates a single table for reporting is a good idea?

    I have ~10 queries that I have to currently run manually and was hoping to drop them into a physical table and then leverage that single table to pull into excel.

    Some of my queries use virtual tables or CTE's, this is to get the aggregate set correctly.

    If you wouldn't mind I would appreciate any ideas around this.

    Essentially I am working out of a data warehouse and would like to eventually get all my queries in one SP or something similar and then call that query for a insert.

    Speaking of which could you create a SP that has several selects than with that output drops the records into a single table by using an insert into query so the data from the all the queries would line up into the right columns?

    Thanks for any insight I really do appreciate it.

  2. #2
    Join Date
    Oct 2014
    Posts
    268
    Provided Answers: 6
    I was able to create the stored procedure and add all my select statements to the SP. Just wondering if inserting from the SP into a table is a good idea.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •