我有一個表student(int ID, nvarchar(10) studentName)
和表用戶類型myStudentType (int ID, nvarchar(10) studentName)
MERGE語句2008
我需要創建一個接受myStudentType
參數(@students
)和參數的存儲過程@newname
mySp(@students myStudentType, @newname nvarchar(10))
,並將myStudentType
與學生合併,以便兩個表上存在ID的所有行現在都將在學生表中具有studentName
- @newname
(參數) 和SP將返回所有從@students在 未更新學生表
什麼是做到這一點的最好方式記錄的列表(與合併的首選)
感謝
我只有部分使用合併來更新學生表中的所有行...我不知道如何獲得所有的記錄沒有更新參數中的sp – 2011-12-19 05:17:55