Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 yet another table design question

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-01-21 : 12:13:35
greetings y'all

I have WorkOrder table where requests from customers are entered. Then tickets are created in Ticket table to handle these work orders. similar work orders, orders that have similar parts are group together. so a ticket could have more than one work order.
now parts are assigned to the tickets. but sometimes the suggested part by the manager is defective or missing from shelve..
so worker on the shop floor might pick an alternate part. but still we want to keep history of parts used from the original one picked by manager to the one picked by worker ... worker could pick 1 to many alternate parts,
should i lay this out in another table or add another field to differentiate between suggested part and actual used part.

thanks
hope my question is clear

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-21 : 12:38:07
seems like what you need is another table which connects tickets with parts containing ticketid (fk to ticket table)and partid (fk to part table). each record corresponds to a part included in a ticket.
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-01-21 : 12:49:40
ok that is what I was thinking but i thought this table would be redundant.
also how will I know which part is legit meaning which part was actually used...if not in AlternatePart (tables) then part used is the one in the TicketParts table?
also what if a ticket now uses two parts (put together make one part) I have two rows in AlternatePart table..which is good..I could do that xml thingy that concatenates the PartNumbers

am I on the right track here?

Gracias!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-21 : 12:52:28
quote:
Originally posted by yosiasz

ok that is what I was thinking but i thought this table would be redundant.
also how will I know which part is legit meaning which part was actually used...if not in AlternatePart (tables) then part used is the one in the TicketParts table?
also what if a ticket now uses two parts (put together make one part) I have two rows in AlternatePart table..which is good..I could do that xml thingy that concatenates the PartNumbers

am I on the right track here?

Gracias!


you could keep a bit field actual indicating if its actual part or alternate one in this table
Go to Top of Page
   

- Advertisement -