all groups > sql server (alternate) > april 2004 >
You're in the

sql server (alternate)

group:

User ID limit per database, Msg 15065


User ID limit per database, Msg 15065 tostberg NO[at]SPAM eastmtn.com
4/28/2004 8:39:25 AM
sql server (alternate):
There appears to be a limit of ~16378 user Id's possible per database.
When adding users we eventually get the message:

[quoted text, click to view]
Server: Msg 15065, Level 16, State 1, Procedure sp_grantdbaccess, Line
160
All user IDs have been assigned.

All of the MSSQL procedures eventually call sp_grantdbaccess which has
the following piece of code:

select @uid = min(uid)+1 from sysusers
where uid >= 5 and uid < (16384 - 1) -- stay in users
range
and user_name(uid+1) is null -- uid not in use
if @uid is null
begin
raiserror(15065,-1,-1)
return (1)
end

so there can not be more than aprox. 16378 users in a database,
don't know why there is this limit, Don't see anything in the groups
talking about it.

Why the limit?
Re: User ID limit per database, Msg 15065 Simon Hayes
4/28/2004 7:23:48 PM

[quoted text, click to view]

Probably 16000+ users per database seemed like a limit no one would ever
reach, because it's so awkward from a management perspective. 2^14 = 16384,
so it's probably not an entirely arbitrary number.

You don't give any background about your security model (especially SQL or
Windows accounts), but using Windows authentication with Windows groups as
logins is one obvious way to reduce the number of users you need to manage,
by shifting the user/group management to the operating system.

This may or may not be a suitable solution for you - if you can clarify why
you need so many users per database (some sort of hosting service?), someone
may be able to suggest an alternative approach.

Simon

AddThis Social Bookmark Button