Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


STORE PROCEDURE


STORE PROCEDURE

Author
Message
hoseam
hoseam
SSC Veteran
SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)

Group: General Forum Members
Points: 233 Visits: 427
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
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47299 Visits: 44392
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


hoseam
hoseam
SSC Veteran
SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)

Group: General Forum Members
Points: 233 Visits: 427
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search