Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

We have the tables in the below two formats. As per my business requirement,  I need to reseed table Id to 3 times of the current/maximum Id value using RESEED concept. I can achieve this for table1 but not for table2.

Table-1:
SQL
CREATE TABLE Client
{
clientId int IDENTITY(1,1) NOT NULL,
Name VARCHAR(100)
}

Table-2:
SQL
CREATE TABLE Nomination
{
NominationId UniqueIdentifier NOT NULL,
NominationName VARCHAR(100)
}


What I have tried:

I have tried to apply the reseed concept on table-2 but its not worked.
Is there any way to reserve Ids in three times of the current max Id for table2 without altering the current table structure from UniqueIdentifier  to identity field.


Thanks,
Sindhu
Posted
Updated 24-Mar-17 5:28am

1 solution

RESEED only applies to IDENTITY columns.

Based on the code you've posted, table 2 does not have an IDENTITY column. Therefore, you cannot use RESEED with that table.
 
Share this answer
 
Comments
Naga Sindhura 24-Mar-17 12:01pm    
Is there any alternative to achieve this? or is possile with NEWSEQUENTIALID if we alter the table?
Richard Deeming 24-Mar-17 12:03pm    
To achieve what?

You CANNOT use RESEED with a uniqueidentifier field.

And it wouldn't make any sense to do so, because a uniqueidentifier is a random 128-bit number, not a sequential ID.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900