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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ashok KumarPosted Dec 18, 2015, 7:44 AM
Ram NunnaPosted Dec 18, 2015, 7:38 AM
Pankaj Kumar ChoudharyPosted Dec 17, 2015, 11:04 AM
Abrar Ahmad AnsariPosted Dec 17, 2015, 6:48 AM
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)
Vishal JadavPosted Dec 17, 2015, 6:31 AM