Reset identity seed after deleting records in SQL Server

0 votes

A SQL Server database table has had records added to it by me. The auto-increment identity seed was set to "Yes" and the table had been defined with a primary key. This is done mostly because each table in SQL Azure needs to have an identity and primary key defined.

The identification seed for those tables will be disturbed, as will the index column (which is automatically generated with an increment of 1), as I have to delete certain data from the table.

How can I reset the identity column after I deleted the records so that the column has a sequence in ascending numerical order?

The identity column is not used as a foreign key anywhere in the database.

Aug 22 in Database by Kithuzzz
• 12,240 points
11 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

Reset AutoIncrement in SQL Server after Delete

In a SQL Server database table, I ...READ MORE

Aug 27 in Database by Kithuzzz
• 12,240 points
12 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9 in Database by Kithuzzz
• 12,240 points
176 views
0 votes
0 answers

How to display two digits after decimal point in SQL Server?

I want to return the value of ...READ MORE

Aug 26 in Database by Kithuzzz
• 12,240 points
34 views
0 votes
0 answers

I want to use CASE statement to update some records in sql server 2005

UPDATE dbo.TestStudents SET LASTNAME = ( ...READ MORE

Sep 2 in Database by Kithuzzz
• 12,240 points
35 views
0 votes
1 answer

What are the different authentication modes in SQL Server? How can it be changed?

Windows mode and Mixed Mode – SQL ...READ MORE

answered Oct 29, 2018 in Database by Sahiti
• 6,380 points
650 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

MERGE INTO YourTable T USING ...READ MORE

answered Feb 3 in Database by Vaani
• 7,020 points
121 views
0 votes
1 answer

How Can I use "Date" Datatype in sql server?

There's problem in all of them and ...READ MORE

answered Feb 9 in Database by Neha
• 8,920 points
167 views
0 votes
1 answer

How to rename a column in a database table using SQL?

For SQL Server, use sp_rename USE AdventureWorks; GO EXEC sp_rename 'Customers.CustomerTerritory.TerritoryID', ...READ MORE

answered Feb 9 in Database by Neha
• 8,920 points
106 views
0 votes
1 answer

Rename column SQL Server 2008

Use sp_rename EXEC sp_RENAME 'TableName.PreviousColumnName' , 'NewColumnName', 'COLUMN' See: SQL SERVER ...READ MORE

answered Feb 23 in Database by Vaani
• 7,020 points
53 views
0 votes
1 answer

How Can I use "Date" Datatype in sql server?

Your dates are interpreted as MM-DD-YYYY. This ...READ MORE

answered Jun 21 in Others by nisha
• 2,180 points
48 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP