Show Bid Request
Trigger/constraints/ stored procedure for a tree
Bid Request Id: 42945
|
|
|
Posted by: |
aramyus (8 ratings)
(Software buyer rating 10)
|
Non-action Ratio: |
Very Good - 23.81%
|
Buyer Security Verifications: |
Excellent
|
Approved on: |
Jan 9, 2003 4:39:29 PM EDT
|
Bidding Closes: |
Jan 16, 2003 EDT
|
Viewed (by coders): |
131 times
|
Deadline: |
1/24/2003
TIME EXPIRED
|
|
|
|
Description:
We have 2 tables :
S S_S
S contains sites (a geographical location, a building, a city, a company...) Sites are linked together in a table S_S A record in S_S indicates ASId is linked to BSid Links should be entered only once
We need two TRANSAC Sql procedures :
a) For a given site in the network, and a given distance d, we want to have the list of the sites 'connected' to the site SId and with maximum distance d from SId. This list must be in a recordset format (select Sid from xxx) and not in a string format (SId1, Sid2...). The distance is the number of levelsthat separate two elements in the tree
b) A set of constraints/ triggers in the table S_S to prevent entering multiple entries and 'tree illegal entries'
Illegal tree entries are those groups of entries that will result in a loop. For example
A linked to B B linked to C C may not be linked to A as it is already linked via B
Suggested solution : have all the records S_S in the form of a regular tree There will be necessarily a top parent, whoc can have one or several children etc...I assume this is the only simple solution
The tables are scripted below There is a record zero in S (Sid = 0, Sname = 'NA' ) that allows to have the constraint Not null on ASid and BSid. This record is simply ignored in the result. The constraint 'Not null' in fields must be kept.
CREATE TABLE [dbo].[S] ( [SId] [int] IDENTITY (1, 1) NOT NULL , [SName] [nvarchar] (100) COLLATE French_CI_AS NOT NULL ) ON [PRIMARY] GO
CREATE TABLE [dbo].[S_S] ( [SSId] [int] IDENTITY (1, 1) NOT NULL , [ASId] [int] NOT NULL , [BSId] [int] NOT NULL ) ON [PRIMARY] GO
ALTER TABLE [dbo].[S] WITH NOCHECK ADD CONSTRAINT [PK_S] PRIMARY KEY CLUSTERED ( [SId] ) ON [PRIMARY] GO
ALTER TABLE [dbo].[S_S] WITH NOCHECK ADD CONSTRAINT [PK_S_S] PRIMARY KEY CLUSTERED ( [SSId] ) ON [PRIMARY] GO
ALTER TABLE [dbo].[S_S] ADD CONSTRAINT [FK_S_S_S] FOREIGN KEY ( [ASId] ) REFERENCES [dbo].[S] ( [SId] ), CONSTRAINT [FK_S_S_S1] FOREIGN KEY ( [BSId] ) REFERENCES [dbo].[S] ( [SId] ) GO
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Complete ownership and distribution copyrights to all work purchased.
Platform:
sql server 2000
Must be 100% finished and received by buyer on:
Jan 24, 2003 EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$30 (USD)
|
Jan 10, 2003 12:49:39 AM EDT
|
8.73
(Superb)
|
|
|
Hello, I can develop this for $30.
Regards,
|
|
|
|
|
|