Jump to content
Do Not Sell My Personal Information


  • Join Toyota Owners Club

    Join Europe's Largest Toyota Community! It's FREE!

     

Sql Server Help


Nick SR
 Share

Recommended Posts

Hi Guys,

Not sure if anyone will be able to give me a yes or no answer on this.

In one particular table, the software writes a record, which has a relationship to one in another table. When this has been written a second is created when confirmed by a user, and although you can't see a field linking the two records when looking you can see which relates to which.

Is there anyway i can make a relationship so i can pull some data from the first row and the second?

I appreciate any help

Nick

Link to comment
Share on other sites

you can make a procedure?

select this1, this2

from thistable, thistable2

where this1 = this2

This is the problem, there isn't two fields where i can say this = this as it doesn't cross reference anything apart from a part and a quantity, the actual reference i want to tie it too remains in record one only.

Nick

Link to comment
Share on other sites

You have to have some way of linking the tables logically. If you can't describe which record in table 1 should link to which record(s) in table 2 then of course there's no way of linking. The computer isn't a mind reader. On the other hand if you can describe a link between the two tables, then linking from one to the other is easy peasy.

Note, the link records don't need to have a common name or even contain exactly the same data - you just need to be able to define the relationship between the two sets of data.

Your first post said there was a relationship between one table and the other - what is that relationship?

Link to comment
Share on other sites


Im assuming you want part and qaunity of something?

Isnt there a product number that could be cross referenced.

How would you do it if you werent doing it on a computer.. how would you find the matches of what you are looking for?

Link to comment
Share on other sites

You have to have some way of linking the tables logically. If you can't describe which record in table 1 should link to which record(s) in table 2 then of course there's no way of linking. The computer isn't a mind reader. On the other hand if you can describe a link between the two tables, then linking from one to the other is easy peasy.

Note, the link records don't need to have a common name or even contain exactly the same data - you just need to be able to define the relationship between the two sets of data.

Your first post said there was a relationship between one table and the other - what is that relationship?

Written to one table is all the required parts, inc the works order number of the parent part they relate to.

Written to table two are the works orders for the manufactured parts required. The only common data is the part number and quantity. Don't think there is anything else i am stil intergating the data, but don't hold out much hope of finding anything.

Nick

Link to comment
Share on other sites

Written to one table is all the required parts, inc the works order number of the parent part they relate to.

Written to table two are the works orders for the manufactured parts required. The only common data is the part number and quantity. Don't think there is anything else i am stil intergating the data, but don't hold out much hope of finding anything.

Nick

Then if you have the part number in both tables won't that form a link between them? Although you have quantity in both, presumably it's not the same quantity in both tables - e.g. one could be a required quantity and the other a manufactured quantity perhaps?

But in any case you can easily construct for example a many to many relationship between the two tables using the part number if that's what you wanted to do. The exact way of doing that would vary depending on exactly what you were trying to achieve with the linked files, and whether there was always at least one W/O per requirement or vice versa etc, etc. Moffmo's example shows you one possible way of creating a link.

HTH.

T

Link to comment
Share on other sites

Written to one table is all the required parts, inc the works order number of the parent part they relate to.

Written to table two are the works orders for the manufactured parts required. The only common data is the part number and quantity. Don't think there is anything else i am stil intergating the data, but don't hold out much hope of finding anything.

Nick

Then if you have the part number in both tables won't that form a link between them? Although you have quantity in both, presumably it's not the same quantity in both tables - e.g. one could be a required quantity and the other a manufactured quantity perhaps?

But in any case you can easily construct for example a many to many relationship between the two tables using the part number if that's what you wanted to do. The exact way of doing that would vary depending on exactly what you were trying to achieve with the linked files, and whether there was always at least one W/O per requirement or vice versa etc, etc. Moffmo's example shows you one possible way of creating a link.

HTH.

T

Thanks for the comments guys, i am going to give this some more thought.

I need to consider how many times the product number could = one and with the same quantity.

I am going to have to think on it.

Nick

Link to comment
Share on other sites

Latest Deals

Toyota Official Store for genuine Toyota parts & accessories

Disclaimer: As the club is an eBay Partner, The club may be compensated if you make a purchase via eBay links

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share







×
×
  • Create New...




Forums


News


Membership