473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Data Of AutoGenerate ID Columns Of Sql-2000 Server

maheshwag
I have a table as below:

Table : Dummy

ACID int, // Autoincrement Columns with Primary Key
Accname Varchar(100)

The ACID of Dummy Table are always increase the value, it’s fine. But the problem is that it’s continue the ID No. after deletion. e.g.:

Expand|Select|Wrap|Line Numbers
  1.  
  2. ACID       accname
  3. -----------------
  4. 1    mahesh
  5. 2    mahendra
  6. 3    kirti
  7.  
  8.  
  9.  

Now I deleted the above data from table and if I try to insert the new data on table than ACID start ID from No. “4” instead of No. “1”.
What to do for start ID at No. “1” again after deletion of old records from the table?
Apr 30 '11 #1

✓ answered by ck9663

Be careful of doing this. If your ACID is related to any other table, you might loose the relationship between the two tables.

What you are looking for is to reseed your identity value. For that, you can start reading this. If you just want to start from 1, use truncate table, not delete.

Good Luck!!!

~~ CK

1 1413
ck9663
2,878 Expert 2GB
Be careful of doing this. If your ACID is related to any other table, you might loose the relationship between the two tables.

What you are looking for is to reseed your identity value. For that, you can start reading this. If you just want to start from 1, use truncate table, not delete.

Good Luck!!!

~~ CK
May 2 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jennifer Smith | last post by:
I want to be able to display my recordset as follows: a e b f c g d h Instead of : a b c d
0
by: GreenFROG Design | last post by:
Data Processing and SQL INSERTING Hello guy's i'm faced with a horrible dilemma i have whole dictionary that i have to enter into a database. I have all the text and i would like to convert it...
6
by: alederer | last post by:
Hallo! I have a table tstest(ts char(13) for bit data constraint a unique). This column is filled in a trigger with generate_unique(). In a application (CLI), I have the values of this...
3
by: markaelkins | last post by:
I want to create a simple user interface to collect the following data and store the data in a SQL database…. Could someone please help me get started? Data to collect from user interface and...
1
by: ypul | last post by:
Hi , Getting to the point directly, my query output doesnt have fixed columns , so I choosed "autogenerate columns" datagrid. I assign this dataset to my datagrid, but now I want my data should...
2
by: Patrick B. | last post by:
I have an existing excel spreadsheet that my customers MUST continue using. There are 5 different specially formatted cell groups (tables) on one sheet where the use can enter data. The data in...
2
by: hazz | last post by:
in a databound scenario I have a database column value that is of type varchar with 3 discrete text values. Binding to this table column with autogenerated columns displays the text values in a...
2
by: Newbie19 | last post by:
I am creating a project that would insert data into a SQL database when the User placed the information into the VB application. Then at a click of a button, it would add this data into the...
1
by: sthiru | last post by:
Hi, i have a sql database and lot of tables. I want to insert and update a sql table from excel. I can retrieve the data from sql table to excel sheet. But i have to send the data back to sql...
0
by: dougancil | last post by:
I have a form that shows users data from a sql query. What I want to be able to do is when users make a change, they press a save button, the edited/changed data is saved to a new table and then the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.