Skip to main content
added identity column to order by
Source Link
Dan Guzman
  • 28.5k
  • 2
  • 46
  • 70

Adding an identity column to the CI key will avoid dups similarly to the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time, identity_column) and select row number 1.

Adding an identity column to the CI key will avoid dups similarly to the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time) and select row number 1.

Adding an identity column to the CI key will avoid dups similarly to the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time, identity_column) and select row number 1.

added 3 characters in body
Source Link

Adding an identity column to the CI key will avoid dups similarly to the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time) and select row number 1.

Adding an identity column to the CI key will avoid dups similarly the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time) and select row number 1.

Adding an identity column to the CI key will avoid dups similarly to the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time) and select row number 1.

Source Link
Dan Guzman
  • 28.5k
  • 2
  • 46
  • 70

Adding an identity column to the CI key will avoid dups similarly the internal uniqueifier value. Be sure to choose a data type like bigint to avoid overflow.

If the source data contains greater time precision than you currently store, consider using datetime2(7) to reduce collisions and provide more accuracy.

When you only care about the first event for a given time, use ROW_NUMBER() OVER(PARTITION BY time ORDER BY time) and select row number 1.