Hello Guys,
I have two tables First One is.
tblSalaryMaster(salaryID,salaryName)
records are 1 Basic, 2 HRA, 3 Ca
and 2nd is tblSalaryDetailMaster(companyID,employeeID,salaryID,salaryAmount)
records are
1 1 1 10000
1 1 2 4000
1 1 3 3000
1 2 1 15000
1 2 2 7000
1 2 3 2000
and so on
now i add one more record to First Table 4 Allowance
as i am updating the second table now i want to compare first table values
with second table and if second table don't have the record(salaryID) then insert the record into
second table.
Please help me.
Loading
Rakesh KaushikPosted Mar 14, 2013, 3:17 AM
actually i am not updating the table from sql server query. i am updating the second table from c#.net form and please write a query how to do this.
Thanks in advance
Vishal GilbilePosted Mar 14, 2013, 2:01 AM
If your are using oracle or Sql Server 2008 version you could easily make use of Merge Command to insert, update or delete rows from source table(First Table) or target table(Second Table).
Hope that solves your problem.
With Regards,
Vishal Gilbile.