Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

STORE PROCEDURE Expand / Collapse
Author
Message
Posted Tuesday, August 14, 2012 3:10 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 3:16 AM
Points: 187, Visits: 320
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
Post #1345045
Posted Tuesday, August 14, 2012 3:23 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 2:01 PM
Points: 40,390, Visits: 36,823
Homework?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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

Post #1345051
Posted Wednesday, August 15, 2012 3:09 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 3:16 AM
Points: 187, Visits: 320
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.
Post #1345178
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse