martes, 23 de febrero de 2016

rowid en SQL Server

Esta es la forma de obtener el número de fila en un select en SQL Server:

select ROW_NUMBER() OVER (ORDER BY codProductoSICEX) AS ID,
          codProductoInsc,
          codProductoSICEX
 from geneproducto
where codProductoSICEX >= '020000001201'
 order by 3

Fuente: http://stackoverflow.com/questions/11762700/how-do-i-get-the-row-id-of-the-table-in-sql-server