Page 1 of 1

OUTROWNUM function

Posted: Fri Jul 25, 2008 1:01 am
by SBSA_DW
Hi Everyone

I'm rewriting a job on the Enterprise Edition which was originally written on the Standard Edition. The job uses the @OUTROWNUM function on one column to count each row and give each row a unique number which doesn't work as well on the Enterprise Edition because numbers are being repeated because of partitioning, can anyone assist?

Posted: Fri Jul 25, 2008 1:26 am
by ray.wurlod
Welcome aboard.

Construct an expression that takes the partition number and number of partitions into account, for example initialize a counter (stage variable) to the partition number and increment it by the number of partitions.

All counters begin at zero; you may wish to add one to your initializations to get something akin to @OUTROWNUM in server jobs.