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.
| Author |
Topic |
|
majidbhutta
Starting Member
13 Posts |
Posted - 2005-11-28 : 11:52:25
|
| In sql database , I have two tables named Emp_Info and Emp_Experiencethe structure of table is like this;Emp_Info========Emp_Id PrimaryKey(Auto)Emp_NameEmp_AgeEmp_Experience==============Exp_Id PrimaryKey(Auto)Emp_Id ForeignKeyExp_DetailExp_Year. . . . ... and so onWorking on a single form, All these fields have to be enterd and are saved against one button click.The Problem is how can i get the Emp_Id for Emp_Experience table to save Experince and Emp_Info paralelly.The relationship btw Emp_Info and Emp_Experience is one to many. that is, Against one Employee there may be none or many Experiences.in the scenario, i have to add Experiences first and then save the Employee? What 2 do? any guide line, help .....>?i need its stored procedure for saving Experiences.Thnx in Advance |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-11-28 : 11:57:28
|
| >> i have to add Experiences first and then save the Employee?Don't.Add the employee first - you will need that for the Emp_Id in Emp_Experience.If necessary just add a stub and update with the correct data later.>> i need its stored procedure for saving ExperiencesAll database access should be via stored procedures.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|