Hi, I want to insert values to one table based on other table id. if ID match then insert the data.
Please give me sample stored procedure query.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vishal JadavRank #1,691 · 901 reputationPosted Dec 17, 2015, 1:31 AM EST
Abrar Ahmad AnsariRank #3,390 · 425 reputationPosted Dec 17, 2015, 1:48 AM EST
insert INTO Employees(FirstName,MiddleName,LastName)
insert INTO Employees(FirstName,MiddleName,LastName)
select emp.FirstName,emp.MiddleName,emp.LastName from COMM.VwActiveEmployee emp
where EXISTS(select 1 from Employees e where e.EmployeeID=emp.EmployeeID)
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Dec 17, 2015, 6:04 AM EST
Ram NunnaRank #8,962 · 213 reputationPosted Dec 18, 2015, 2:38 AM EST
Ashok Kumar45 reputationPosted Dec 18, 2015, 2:44 AM EST