I have a table student(int ID, nvarchar(10) studentName)
and a table user type myStudentType (int ID, nvarchar(10) studentName)
I need to create a stored procedure that accepts a myStudentType
parameter (@students
) and a parameter @newname
mySp(@students myStudentType, @newname nvarchar(10))
and merges myStudentType
with student so that all the rows with ids that exists on both tables will now in student table have for the studentName
- @newname
(the parameter)
and the sp will return a list of all the records from @students that were not updated in
the student table
What is the best way to do that (preferred with merge)
thanks