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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:50:52+00:00 2026-05-11T19:50:52+00:00

A week or so ago some data got imported into a db table. Simple

  • 0

A week or so ago some data got imported into a db table. Simple table:

Id INT PK NOT NULL IDENTITY
Name VARCHAR(20)

Now, I noticed today that the first id starts at 0. Asking the kid, he was reseeding it during his testing. So the first entry was a zero. Was an accident.

I’m not sure how to best update the value. How can I push everything up one number? What pains me is that there’s also some FK dependencies. If I have Cascade Update, should that fix the dependencies?

Also, should I update each number (however I do that??) from the top down .. eg. from the highest number, then +1. Then go down.

  • 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-11T19:50:52+00:00Added an answer on May 11, 2026 at 7:50 pm

    First of all, why are you stressing? ID=0 is complete valid, if a bit unusual. (Note that Zero Is NOT NULL)

    If you really want to get rid of the 0:

    • add a dummy record,
    • note it’s ID,
    • If there are foreign keys pointing to Record 0, update them to the dummy record.
    • delete that record. (to advance the internal ID counter).
    • Just change ID 0 to that value.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer typedef vector<vector<string> > Rows; Rows rows; ifstream input("filename.csv"); char const… May 12, 2026 at 12:44 am
  • Editorial Team
    Editorial Team added an answer if($facebook) { $fb_active_session = $facebook->fbc_is_session_active(); } else { $fb_active_session =… May 12, 2026 at 12:44 am
  • Editorial Team
    Editorial Team added an answer The answer from ChrisF is correct as far as StringBuilder.Append… May 12, 2026 at 12:44 am

Related Questions

I installed Visual Studio 2008 Standard Edition a month or so ago after a
First off, either A) I'm not investigating into this hard enough or B) I've
I have an application which is running on tomcat, one of the methods is,
Open up a Rails console and enter this: 2.weeks.ago.between? 2.weeks.ago, 1.week.ago Did it give

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.