Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8531827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:34:30+00:00 2026-06-11T09:34:30+00:00

Can database Ids be negative in SQL Server? I know that you can have

  • 0

Can database Ids be negative in SQL Server?

I know that you can have a total 32767 (for both 32 bit and 64 bit) (Maximum Capacity SQL Server)

I know that the first few database Ids are reserved for master, model, msdb and tempdb and 32767 is the hidden system resource database.

I have never seen a negative database Id but I would like to confirm that it is not possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:34:31+00:00Added an answer on June 11, 2026 at 9:34 am

    In short, they can be, but they almost never are.

    In the master DB, the id column in the sysdatabases table is defined as an identity column with seed 1 and increment 1. That means that, by default, SQL Server will always assign a positive DBID for any database you create.

    However, it is possible to change,you can specify negative seeds and increments for identity columns,so you can reset the identity column of the sysdatabases table to -1, -1 and the next database you create will have ID -1, then -2, etc. -1 is a perfectly valid 16-bit integer value and so the identity field should have no trouble. You may have an issue with SQL Server naively checking the number of DBs it manages by checking the max DBID. I would not expect MSS to make that check in such a stupid way, but stranger things have happened, and I’ve never seen an instance with more than a couple dozen DBs on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code in php/mysql that gets ids from the database. The ids
I have a centrally hosted database (MS SQL Server) and distributed clients save data
I have an SQL Azure database with a table that has JobId primary key.
I have an application that stores database IDs in session while editing several pages
My MySQL database can store the euro symbol just fine (as I have tested
I'm writing a lightweight ORM that can map database columns to instance fields with
How save insert sctipts in separate sql files in MySqlWorkbent? I can create database
Let's say I have a simple database with tables 'posts' and 'tags'. Posts can
I have a many to many table setup in my mysql database. Teams can
I have an Access database that is corrupted beyond all repair (don't ask me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.