Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
HELP SQL Stored Procedure for Webservice
Old 10-27-2006, 07:57 PM HELP SQL Stored Procedure for Webservice
Junior Talker

Posts: 2
Location: Virginia
Trades: 0
Hello, I am working on a web service for retreving news updates and need some help with a stored procedure.

I have 3 tables

1. tblstory ( to hold the news article, headline, date etc)
fldstoryID (PK)
fldheadline
fldstory
flddate
fldtype

2. tblsymbol ( to hold stock symbol, company name, industry)
fldsymbolID (PK)
fldsymbol
fldcompanyname
fldindustry

3. tblstorysymbol ( to hold the storyID and symbolID - many to many)
fldstorysymbolID (PK)
fldstoryID (FK)
fldsymbolID (FK)

I want to be able to have a stored procedure to insert a new story into the above tables by sending it the symbol, headline, story, date, and category.

A. It has to create a tblstory record with the passed headline, story, date and category
B. Lookup the passed stock symbol in tblsymbol and return the symbolID of that stock symbol if it exists otherwise add the stock symbol to the tblsymbol
C. Create a tblstorysymbol record with the storyID and stockID

If you have any suggestions I would appreciate it. This is being done in MSSQL 7.

Here is a copy of the view I use in case it helps-

SELECT dbo.tblsymbol.fldsymbol AS Symbol, dbo.tblstory.fldheadline AS Headline, dbo.tblstory.fldstory AS Story, dbo.tblstory.flddate,
dbo.tblstory.fldtime
FROM dbo.tblsymbol LEFT OUTER JOIN
dbo.tblstorysymbol ON dbo.tblsymbol.fldsymbolID = dbo.tblstorysymbol.fldsymbolID FULL OUTER JOIN
dbo.tblstory ON dbo.tblstorysymbol.fldstoryID = dbo.tblstory.fldstoryID
WHERE (dbo.tblsymbol.fldsymbol = '[GOOG]')



Thanks in advance
btcarver is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to HELP SQL Stored Procedure for Webservice
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08426 seconds with 12 queries