如何遍历表数据?
DECLARE @STR_DetailId TABLE(DetailId INT,Old BIT) /*新老子单编号表*/
DECLARE Employee_Cursor CURSOR FORSELECT EmployeeID, Title FROM AdventureWorks.HumanResources.Employee;OPEN Employee_Cursor;FETCH NEXT FROM Employee_Cursor;WHILE @@FETCH_STATUS = 0 BEGIN FETCH NEXT FROM Employee_Cursor; END;CLOSE Employee_Cursor;DEALLOCATE Employee_Cursor;GO
[解决办法]
游标!
[解决办法]
游标!