473,416 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Transactions question

I am re-writing a .net web site for a fantasy baseball site I host out of my house and would like to be able to look back at rosters based on a given date. For example I want to be able to look at my roster 6 months ago so that I might see where I went wrong. :) I am already recording all my transactions in a transaction table that contains a date/time stamp but I am not sure how to stucture the table so that I might querry for the 40 man roster at a given date.
Aug 6 '10 #1
5 1183
NeoPa
32,556 Expert Mod 16PB
I have no idea what you're storing, as you share no details, but if the transactions have an associated after image somewhere (Can be stored in a separate table but timestamp critical), then you could write a view to display the position for any/all players at that date.

It's mainly about how you store your data. So far we have no information on that score.

Welcome to Bytes Bill!
Aug 6 '10 #2
I currently am storing

transaction_details_id
transaction_id
manager_id
player_id (This would be a player in a given tranaction)
draft_id (this would be a draft pick that could be included in a trade)
destination_team
timestamp

the issue I am worried about is with the timestamp how would I querry for a 40 man roster at a given point due to the ever evolving changes to a roster the last 40 additions would have players that would since be cut. I am a sql noob but thought this would be an entertaining feature. Thanks for the help
Aug 6 '10 #3
NeoPa
32,556 Expert Mod 16PB
It may be possible to do this with transactions alone. It probably is with a Stored Procedure.

What I would propose though, is an AfterImage logging table for your core data (not the transactions as you've shown details of here). That would be much easier to process through with a subquery or CTE (Common Table Expression) to identify which item of each player is the last saved before the cutoff point.
Aug 6 '10 #4
Jerry Winston
145 Expert 100+
If I understand your question correctly, you can query based on the date and transaction type to find out what your roster looked like.

I think this is the CTE solution NeoPa was talking about:
Expand|Select|Wrap|Line Numbers
  1. WITH tblPlayerID AS 
  2. (
  3. SELECT TOP 40 player_id FROM myTransactionTable
  4. WHERE
  5. timestamp < cast('someDate' as datetime)
  6. AND destination_team = 'MyTeam'
  7. AND transaction_id = 'Signed'
  8. ORDER BY timestamp
  9. )
  10. SELECT first_name,last_name FROM tbl_Players P
  11. INNER JOIN
  12. tblPlayerID ID
  13. ON
  14. P.player_id=ID.player_id
Aug 10 '10 #5
NeoPa
32,556 Expert Mod 16PB
This is actually the more complicated approach that I was going to avoid :D

I'm sure it's possible to do, but my understanding of exactly how the data was stored has never been adequate for me to formulate sensible SQL for it.

One think I'd suggest is that this SQL, if I read it correctly with my limited understanding of the data structure, may return the same [Player_ID] twice, if that player moved twice within the last 40 transactions (priot to the cut-off date).
Aug 10 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
15
by: designconcepts | last post by:
bo'jour, bo'jour, So I have question to present to the forum about OOD. This is a Csharp forum, but C# is the lang of choice and the question is an exercise based on some comments by the chief...
9
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a...
2
by: groups.james | last post by:
I have basically inherited an old classic ASP 3.0 application. Overall it's design was a n-tier design (not always adhered to...) VB6 COM objects for the Business Layer - hosted in COM+ VB6 COM...
12
by: Rami | last post by:
I have some requirement for an automated payment system. The system has four machines setup as follows: 1- Two machines have a clustered database. 2- Two machines have a .net business logic...
10
by: e_matthes | last post by:
Hello everyone, I have read many threads about concurrency issues, and I think I understand some of the pieces, but not the whole picture. I believe I am like many people using php: ...
3
by: Ken | last post by:
I used the classes (SqlCommand, SqlConnection) of part of System.Data namespace. I got an error which mentioned "Could not load file or assembly assembly 'System.Transactions, Version=2.0.0.0,...
3
by: kerry2807 | last post by:
Hi, Am starting to teach myself SQL. I cannot figure out how to do the most simple of queries, and it is driving me nuts. Here's the basic scenario: Table: Customer custid firstname lastname...
3
by: Paul H | last post by:
I have a transactions table and a balance table that look something like this: tblTransactions TransactionID (PK Autonumber) ClientID TransactionDate TransactionAmount (currency field, values...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.