473,382 Members | 1,078 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,382 software developers and data experts.

how to update foreign key while primary is auto generate int

Hi,
I've 3 Tables, Return Product, Shipping, and RMA. The Shipping table has 2 foreign key, 1 connected to RMA, another connected to Return_Product. The primary of the Return_Product is a auto generated int. So, how am supose to do update the foregin key when a new product is inserted to Return_Product Table.?
Please help. I'm new on designing SQL table. I'll appreaciate your help...thanks.

AP
Jun 13 '07 #1
5 2464
bartonc
6,596 Expert 4TB
Hi,
I've 3 Tables, Return Product, Shipping, and RMA. The Shipping table has 2 foreign key, 1 connected to RMA, another connected to Return_Product. The primary of the Return_Product is a auto generated int. So, how am supose to do update the foregin key when a new product is inserted to Return_Product Table.?
Please help. I'm new on designing SQL table. I'll appreaciate your help...thanks.

AP
It will be better for you to find the specific DB help forum in the "Forums" tab above. Or tell us your DB and we'll direct you to that forum.

thanks for joining.
Jun 13 '07 #2
It will be better for you to find the specific DB help forum in the "Forums" tab above. Or tell us your DB and we'll direct you to that forum.

thanks for joining.
I'm using MS SQL 2005. Please tell me which forum I should go. Thanks again
Jun 13 '07 #3
DeMan
1,806 1GB
Moving to MySQL......
Jun 13 '07 #4
Purple
404 Expert 256MB
Hi alanpang,

Apologies for the delay, I think your post was missed because it had been moved into this forum.

Can you post the sql to define the three tables and I will take a look at this for you..

Welcome to the MSSQL forum of TSDN

Regards Purple
Jun 14 '07 #5
DeMan
1,806 1GB
my apologies.....I read his post too quickly!
Jun 14 '07 #6

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

Similar topics

2
by: Gunnar Vøyenli | last post by:
Hi! For the sake of simplicity, I have three tables, Employee, Department and Work Employee >---- Department \ / \ / ^ ^ Work
0
by: Jerry Brenner | last post by:
Our users have potentially dirty legacy data that they need to get into our application. We provide a set of staging tables, which map to our source tables, that the users do their ETL into. ...
1
by: James E | last post by:
I have a question about best practices of how to deal with lookup data from my C# apps. On a couple of occasions I have come across a problem where I have to automate inserting a record into a...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
7
by: robert | last post by:
i need to update a column which is a member of the PK on this table. there are some thousands of rows to be updated, many more thousand already in the table. so, i get a constraint violation...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
3
by: Simon | last post by:
Hi everyone, I have a small problem regarding a wizard that I'm making on my website. The wizard is obviously a series of pages that take values from the user. My question is: - Should I...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.