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 274727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:39:17+00:00 2026-05-12T00:39:17+00:00

My database has a table with thousands of records. The primary key is an

  • 0

My database has a table with thousands of records. The primary key is an integer. There’s a lot of foreign key constraints associated with this column.

I want to change this column to become an identity key. What’s the best way to do it? I also need to send this update to our clients installations.

Bonus points for an answer that works in Sql Server 2000.

  • 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-05-12T00:39:17+00:00Added an answer on May 12, 2026 at 12:39 am

    There’s a great feature in SQL Server Management Studio that saved my day.

    In SSMS go to Options -> Designers -> Table and Database Designers, check "Auto generate change scripts" and uncheck "Prevent saving changes that require table re-creation".

    In object explorer, go to your table and select the column that will get the Identity specification. Right click and select modify. In the Column properties panel, expand the tree "Identity Specification" and change "(Is Identity)" to yes. Now on the upper left size, select the icon "Generate script". Pay attention to the warning messages.

    Now you will have a generated script that will drop all your constraints, recreate the table with identity, and recreate the constraints. WOW!

    I’ll test it and post here my results.

    Update: Everything worked fine. I forgot to say in the question that I need the script to reproduce the modification in our clients installations.

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

Sidebar

Related Questions

Table has surrogate primary key generated from sequence. Unfortunately, this sequence is used for
I'm using http://keith-wood.name/countdown.html . Each 'Event' table in my database has a 'date' column.
I have a database that stores thousands of bookmarks and the table BM_Table has
I have several tables in a database. One table (tbl_transactions) has thousands of orphaned
I have a two tables. TABLE 1 has id(PRIMARY)|RANK|WEBSITE |ADDRESS This is filled with
My database has an organisation table and an address table. In the address table,
I have a database that has a table email_eml that stores 3 attributes name_eml,
I have a database which has a table recording when a vehicle was last
I have a SQL database that has a table with a field set to
I have a ms access database that has one table for each photo album

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.