Combine multiple stored procedures into one reportHow big should I make a column in an audit table for...

Is this Article About Possible Mirrored Universe Junk Science?

How can I keep my gold safe from other PCs?

Does Plato's "Ring of Gyges" have a corrupting influence on its wearer?

Is it possible to detect 100% of SQLi with a simple regex?

How do I avoid the "chosen hero" feeling?

How bad is a Computer Science course that doesn't teach Design Patterns?

If I tried and failed to start my own business, how do I apply for a job without job experience?

Players preemptively rolling, even though their rolls are useless or are checking the wrong skills

Why is it that Bernie Sanders is always called a "socialist"?

How can I give a Ranger advantage on a check due to Favored Enemy without spoiling the story for the player?

Inline Feynman diagrams, Feynman diagrams in equations, very small Feynman diagrams

Is the UK legally prevented from having another referendum on Brexit?

How to regain lost focus?

Is practicing on a digital piano harmful to an experienced piano player?

Including proofs of known theorems in master's thesis

How can I differentiate duration vs starting time

Why can't i set the 'prototype' of a function created using 'bind'?

What does "south of due west" mean?

Neglect higher order derivatives in expression

How can guns be countered by melee combat without raw-ability or exceptional explanations?

Linearity Assumption

How can I prevent an oracle who can see into the past from knowing everything that has happened?

Is the percentage symbol a constant?

Expression for "unconsciously using words (or accents) used by a person you often talk with or listen to"?



Combine multiple stored procedures into one report


How big should I make a column in an audit table for storing the output of COLUMNS_UPDATED()?Why does OBJECT_ID return NULL in a computed column?Update Table from SP in SSISStored Procedures execution permissionsHow to combine 2 SQL statements into one?Same code in multiple stored proceduresMultiple Non-Indexed Views with INCLUDEs vs. Multiple Indexed Views in High Write SituationsCombining multiple query result sets that share common columns into one specified temp tableCompile TSQL stored procedures into assemblyInsert multiple values into stored procedure













0















This is my first time doing this... For my assignment, I need to combine multiple stored procedures into one big report using a cursor. There is only one table Debt from the database college. Here is a link to the data dictionary:
Data Dictionary



The output for my report is supposed to output these values for a college name or even a partial match to a string.
output for report



Currently, this is one of the 4 stored procedures that I have to output at 10%, 25%, 75%, and 90%. I'm trying to combine 10%, 25%, 75%, and 90% into one report when I execute the combined stored procedure. Also, when searching for a string in the combined stored procedure it will return any similar values. For example, the string 'ala' returns any strings in the format specified and in this case, it would probably return all colleges relating to Alamaba.



USE [college]
GO
/****** Object: StoredProcedure [dbo].[sp_10Report] Script Date:
2/23/2019 1:41:44 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[sp_10Report] (
@UNITID float
)
AS
BEGIN


DECLARE @INSTNM VARCHAR(200)
DECLARE @Query NVARCHAR(500)
DECLARE @CUML_DEBT_P10 float
DECLARE @CUML_DEBT_N float

DECLARE @AVG10 float
DECLARE @AVGN float
DECLARE @SUMN float
DECLARE @WAVG float

SET @AVG10 = (select AVG(CUML_DEBT_P10) from Debt)
SET @AVGN = (select AVG(CUML_DEBT_N) from Debt)
SET @WAVG = (select SUM(CUML_DEBT_P10*CUML_DEBT_N)/SUM(CUML_DEBT_N) from Debt)

select 'Cumilative debt at 10%' as Satistic,
CUML_DEBT_P10 as 'Institution Value',
@AVG10 as 'Average Value',
@WAVG as 'Weighted Average' from Debt
where UNITID = @UNITID

END
GO








share







New contributor




Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    This is my first time doing this... For my assignment, I need to combine multiple stored procedures into one big report using a cursor. There is only one table Debt from the database college. Here is a link to the data dictionary:
    Data Dictionary



    The output for my report is supposed to output these values for a college name or even a partial match to a string.
    output for report



    Currently, this is one of the 4 stored procedures that I have to output at 10%, 25%, 75%, and 90%. I'm trying to combine 10%, 25%, 75%, and 90% into one report when I execute the combined stored procedure. Also, when searching for a string in the combined stored procedure it will return any similar values. For example, the string 'ala' returns any strings in the format specified and in this case, it would probably return all colleges relating to Alamaba.



    USE [college]
    GO
    /****** Object: StoredProcedure [dbo].[sp_10Report] Script Date:
    2/23/2019 1:41:44 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    CREATE PROCEDURE [dbo].[sp_10Report] (
    @UNITID float
    )
    AS
    BEGIN


    DECLARE @INSTNM VARCHAR(200)
    DECLARE @Query NVARCHAR(500)
    DECLARE @CUML_DEBT_P10 float
    DECLARE @CUML_DEBT_N float

    DECLARE @AVG10 float
    DECLARE @AVGN float
    DECLARE @SUMN float
    DECLARE @WAVG float

    SET @AVG10 = (select AVG(CUML_DEBT_P10) from Debt)
    SET @AVGN = (select AVG(CUML_DEBT_N) from Debt)
    SET @WAVG = (select SUM(CUML_DEBT_P10*CUML_DEBT_N)/SUM(CUML_DEBT_N) from Debt)

    select 'Cumilative debt at 10%' as Satistic,
    CUML_DEBT_P10 as 'Institution Value',
    @AVG10 as 'Average Value',
    @WAVG as 'Weighted Average' from Debt
    where UNITID = @UNITID

    END
    GO








    share







    New contributor




    Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      This is my first time doing this... For my assignment, I need to combine multiple stored procedures into one big report using a cursor. There is only one table Debt from the database college. Here is a link to the data dictionary:
      Data Dictionary



      The output for my report is supposed to output these values for a college name or even a partial match to a string.
      output for report



      Currently, this is one of the 4 stored procedures that I have to output at 10%, 25%, 75%, and 90%. I'm trying to combine 10%, 25%, 75%, and 90% into one report when I execute the combined stored procedure. Also, when searching for a string in the combined stored procedure it will return any similar values. For example, the string 'ala' returns any strings in the format specified and in this case, it would probably return all colleges relating to Alamaba.



      USE [college]
      GO
      /****** Object: StoredProcedure [dbo].[sp_10Report] Script Date:
      2/23/2019 1:41:44 PM ******/
      SET ANSI_NULLS ON
      GO
      SET QUOTED_IDENTIFIER ON
      GO

      CREATE PROCEDURE [dbo].[sp_10Report] (
      @UNITID float
      )
      AS
      BEGIN


      DECLARE @INSTNM VARCHAR(200)
      DECLARE @Query NVARCHAR(500)
      DECLARE @CUML_DEBT_P10 float
      DECLARE @CUML_DEBT_N float

      DECLARE @AVG10 float
      DECLARE @AVGN float
      DECLARE @SUMN float
      DECLARE @WAVG float

      SET @AVG10 = (select AVG(CUML_DEBT_P10) from Debt)
      SET @AVGN = (select AVG(CUML_DEBT_N) from Debt)
      SET @WAVG = (select SUM(CUML_DEBT_P10*CUML_DEBT_N)/SUM(CUML_DEBT_N) from Debt)

      select 'Cumilative debt at 10%' as Satistic,
      CUML_DEBT_P10 as 'Institution Value',
      @AVG10 as 'Average Value',
      @WAVG as 'Weighted Average' from Debt
      where UNITID = @UNITID

      END
      GO








      share







      New contributor




      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      This is my first time doing this... For my assignment, I need to combine multiple stored procedures into one big report using a cursor. There is only one table Debt from the database college. Here is a link to the data dictionary:
      Data Dictionary



      The output for my report is supposed to output these values for a college name or even a partial match to a string.
      output for report



      Currently, this is one of the 4 stored procedures that I have to output at 10%, 25%, 75%, and 90%. I'm trying to combine 10%, 25%, 75%, and 90% into one report when I execute the combined stored procedure. Also, when searching for a string in the combined stored procedure it will return any similar values. For example, the string 'ala' returns any strings in the format specified and in this case, it would probably return all colleges relating to Alamaba.



      USE [college]
      GO
      /****** Object: StoredProcedure [dbo].[sp_10Report] Script Date:
      2/23/2019 1:41:44 PM ******/
      SET ANSI_NULLS ON
      GO
      SET QUOTED_IDENTIFIER ON
      GO

      CREATE PROCEDURE [dbo].[sp_10Report] (
      @UNITID float
      )
      AS
      BEGIN


      DECLARE @INSTNM VARCHAR(200)
      DECLARE @Query NVARCHAR(500)
      DECLARE @CUML_DEBT_P10 float
      DECLARE @CUML_DEBT_N float

      DECLARE @AVG10 float
      DECLARE @AVGN float
      DECLARE @SUMN float
      DECLARE @WAVG float

      SET @AVG10 = (select AVG(CUML_DEBT_P10) from Debt)
      SET @AVGN = (select AVG(CUML_DEBT_N) from Debt)
      SET @WAVG = (select SUM(CUML_DEBT_P10*CUML_DEBT_N)/SUM(CUML_DEBT_N) from Debt)

      select 'Cumilative debt at 10%' as Satistic,
      CUML_DEBT_P10 as 'Institution Value',
      @AVG10 as 'Average Value',
      @WAVG as 'Weighted Average' from Debt
      where UNITID = @UNITID

      END
      GO






      t-sql





      share







      New contributor




      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      Andrew PolemeniAndrew Polemeni

      11




      11




      New contributor




      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Andrew Polemeni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Andrew Polemeni is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230560%2fcombine-multiple-stored-procedures-into-one-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Andrew Polemeni is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Andrew Polemeni is a new contributor. Be nice, and check out our Code of Conduct.













          Andrew Polemeni is a new contributor. Be nice, and check out our Code of Conduct.












          Andrew Polemeni is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230560%2fcombine-multiple-stored-procedures-into-one-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

          Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

          How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...