February 20, 2024 at 8:40 am
Alter table query to change identity column from int to bigint in sql2019 server
February 20, 2024 at 8:47 am
Alter table query to change identity column from int to bigint in sql2019 server
What is your question?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
February 20, 2024 at 9:09 am
have a large Table having Identity column as Int and value has neared the max value so need to make the identity column as BigInt
February 20, 2024 at 9:15 am
Is it so difficult for you to ask a question?
Can anyone provide the T-SQL code I need to amend an identity column from INT to BIGINT, please?
I am guessing that this is what you are asking. If not, what are you hoping for?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
February 20, 2024 at 9:22 am
Yes
February 20, 2024 at 9:25 am
DROP TABLE IF EXISTS #SomeData;
CREATE TABLE #SomeData
(
SomeId INT IDENTITY(1, 1)
,SomeText VARCHAR(10)
,CONSTRAINT PK_Nonsense
PRIMARY KEY CLUSTERED(SomeId)
);
ALTER TABLE #SomeData DROP CONSTRAINT IF EXISTS PK_Nonsense;
ALTER TABLE #SomeData ALTER COLUMN SomeId BIGINT;
ALTER TABLE #SomeData ADD CONSTRAINT PK_Nonsense PRIMARY KEY(SomeId);
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
February 20, 2024 at 9:36 am
Thanks Phil
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply