Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I have a table, table1, and created a detail table of table1, I want to move the value of a field of the master table to the detail table without do it manually (about 700 records), is there any way through sql or vb .net?
master table id (PK), name, carnum, address, ssn, ead, sub (integer want to move value to detail field for each master record)
detail table id (PK), id_2 (FK), year, sub (in this field I want to move the value of sub for each master record), receip_num
Posted
Updated 1-Jun-14 21:07pm
v2
Comments
Karthik_Mahalingam 2-Jun-14 2:30am    
Please add more info to the question
by providing the column names,Table name,etc...
Abhishek Pant 2-Jun-14 2:41am    
I recommend to use joins in sql. We can only recommend in this case as we cannot see your screen(Need more info about question).

Use Cursor[^] to move/Update the records from one table to the other.

How to use Cursor in Sql[^]
 
Share this answer
 
Comments
Abhishek Pant 2-Jun-14 3:09am    
a good choice
u can use trigger on master table inserted action.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900