Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 STORE PROCEDURE

Author  Topic 

stahorse
Yak Posting Veteran

86 Posts

Posted - 2012-08-14 : 16:59:48
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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-14 : 17:03:22
we wont provide homework/assignment answers!
post what you've tried so far and then explain issues faced
then we will try to help you out

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -