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 |
|
ameya_amu
Starting Member
25 Posts |
Posted - 2008-08-20 : 03:05:07
|
| hello friendsi have 2 table table employee and employee_education.i want to create storeprocedure. when i insert record in employee table i need on relatedto that employee id(which is auto incremented) i need to insert four(number may vary) record in employee_education tableif any of the four record in the employee_education cannot be saved due to any problem then the whole transaction should be rollback.can any one help me out . is storeprocedure is suitable or any other alternative. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-20 : 04:21:30
|
| you can do this in a procedure. how will you decide values for four (or any number) of records for insertion? provide some sample data. |
 |
|
|
ameya_amu
Starting Member
25 Posts |
Posted - 2008-08-20 : 06:14:26
|
| i have following tabel 1) Employee with following fields i) Emp_id (auto increment)(PK) ii) Emp_name (nvarchar)2) Employee_Education with following fields i) EE_ID (auto increment)(PK) ii) Emp_id (FK) iii) Degree (nvarchar)i have following record in Employee table1 A2 B3 Ci have following records in Employee_Education1 1 M-Com 2 1 MCA3 2 M-COM4 2 MCAT |
 |
|
|
|
|
|