TSQL Dynamic Update of TOP(n) Rows
问题 i have a table with one line per travel second table has values of origin and destination and quantity for each combination i need to run an update that run on the second table that update top N rows on the first table (n comes from the second table) im using this update script inside a cursor in a procedure : ALTER PROCEDURE [dbo].[SP_Travels_History_FromMissing] AS BEGIN SET NOCOUNT ON; DECLARE @C_Day_Type_Code INT = NULL DECLARE @C_PartOfDay_Code INT = NULL DECLARE @C_Station_From INT =