Utilisez plusieurs clauses ROW_NUMBER par colonne et choisissez celle qui convient :
....
ROW_NUMBER() OVER (ORDER BY [Column1]) as rn1,
ROW_NUMBER() OVER (ORDER BY [Column2]) as rn2,
ROW_NUMBER() OVER (ORDER BY [Column3]) as rn3,
ROW_NUMBER() OVER (ORDER BY [Column4]) as rn4
....
OU utiliser une expression CASE. Remarque :tous les types de données doivent être compatibles
ROW_NUMBER() OVER (ORDER BY CASE @sort
WHEN 1 THEN [Column1]
WHEN 1 THEN [Column2]
WHEN 1 THEN [Column3]
...
END
OU Si vous voulez vraiment un numéro de ligne arbitraire, faites ceci :
ROW_NUMBER() OVER (ORDER BY (SELECT 1)) as rn