Hi
How can I insert record R1 to Person Table
Record: R1
ID: 28
Person_Id: 28
Name: Sara
Family: Iranmanesh
Table: Person
ID: Autonumber
Person_Id: number
Name: Char[30]
Family: Char[40]
Note: This table belongs to an mdb file.
Regards,
Elham

Embarrassing Problem with inserting record...!
rs12345
I sense some redundancy in your schema. What’s the difference between ID and Person_Id
philip.engstrom
omron
It looks like R1.ID and R1.Person_ID are the same
DECLARE @PersonID int
DECLARE @Name Char(30)
DECLARE @Family Char(40)
SET @PersonID = (SELECT Person_ID from Table1 WHERE ID = 28),
@Name = (SELECT Name from Table1 WHERE ID = 28),
@Family = (SELECT Family from Table1 WHERE ID = 28)
INSERT INTO Person(Person_ID, Name, Family) VALUES(@PersonID, @Name, @Family)
...or if it's more than one record, you'll need a cursor
...and if it's a regular task, you might want to write a stored procedure.
If so, respond and I'll post the code.
Adamus
Schayin
http://www.kbalertz.com/kb_Q208391.aspx
I got it now then decide to share with the others in this forum.
Regards