HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Max number of sequence objects

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
numbermaxobjectssequence

Problem

At my job we have a lot of objects that we track versions of. We are tentatively looking at creating a rather large number of sequence objects in order to keep track of these version. My concern is that sql server may have a max number of these that we can create, but I am unable to find any such documentation.

So, is there a max number of sequences that can be created in SQL Server 2014 and 2016?

Solution

What is a Sequence?


A sequence is a user-defined schema bound object that generates a
sequence of numeric values according to the specification with which
the sequence was created.

MSDN on Sequence definition reference.

Ok, it's a schema bound user defined object. What does SQL say about how many User Defined Objects we can have?


Database objects include objects such as tables, views, stored
procedures, user-defined functions, triggers, rules, defaults, and
constraints. The sum of the number of all objects in a database cannot
exceed 2,147,483,647.

MSDN on maximum UDF reference.

Summary answer: You can have 2,147,483,647 objects in a database. One of those objects referenced would be Sequence Objects which Sequences fall into that category. This is not explicitly stated, but it can be contrived from the wording "... the sum of the number of all objects in a database cannot exceed 2,147,483,647."

Context

StackExchange Database Administrators Q#210059, answer score: 3

Revisions (0)

No revisions yet.