STORE PROCEDURE

  • Hi

    I have to tables and I have to create a store procedure which gives a problem here can anyone help.. here are my tables

    CREATE TABLE CurrencyCF (CurrencyId int identity (1,1)not null primary key(CurrencyId),

    ToCurrencyId decimal(9) not null,

    CreationDate datetime not null default current_timestamp,

    CurrencyCF decimal(18,2) not null check (CurrencyCF between 0 and 10)

    )

    CREATE TABLE MarketParticipant(MarketParticipantId int identity (1,1) not null primary key(MarketParticipantId), MarketParticipantName char(100) not null default 'Not Applicable', CurrencyId int not null foreign key references CurrencyCF,

    Amount numeric(20,2), CreationDate datetime,

    LastUpdated datetime default current_timestamp,)

    And the question:

    .) Create a Stored Procedure "sMarketParticipantUpdate" under the CDS Schema that does the following:

    - Accepts input of the Marketparticipant Name

    - Based on the marketparticipant name it will update the Adjusted amount column in MarketParticipant

    to be the amount*currencycf amount in the CurrencyCF table

    - Select out, in one select statement, all the CurrencyIds from the CurrencyCF as well as all the data from MarketParticipant(Whether the currenyId

    exist in Marketparticipant or not) and insert in into a temp table called "FinalResults"

    - Select out the data from the temp table

    - Execute the stored procedure

  • Homework?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • No it was work, I didn't understand the question, I had an issue with inserting values and that store proc, but I'm ok now it was just a clarify on the question.

Viewing 3 posts - 1 through 2 (of 2 total)

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