0

I am brushing up my knowledge about SQL and I am learning more and more. However, I am not understanding the purpose of the Sequence we use. I am using SQL Server.

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
cbirole
  • 27
  • 1

1 Answers1

1

The sequence object is an alternative, more flexible key-generating mechanism than identity. Unlike identity, it’s not tied to a particular column in a particular table. Whenever you need to generate a new value, you invoke a function against the object and use the returned value wherever you like. It also supports specifying a minimum value and a maximum value, and cycling too.

Zakaria
  • 4,643
  • 2
  • 4
  • 29