November 8, 2023 at 12:00 am
Comments posted to this topic are about the item Changing the PK - I
November 8, 2023 at 8:46 am
I don't agree with this. I ran the code in my sandbox and it returned
Msg 2749, Level 16, State 3, Line 6
Identity column 'InvoiceID' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, unencrypted, and constrained to be nonnullable.
This, to me, doesn't betoken being unable to remove the identity property, more that you can't change the data type, although none of the options really matches.
November 8, 2023 at 3:55 pm
You'd be wrong. You can change the data type of an identity property column to one of the types in the error. What you cannot do is remove the identity property, so you can't change the data type to an incompatible data type.
November 8, 2023 at 5:03 pm
Ah thank you Steve. Every day is a school day, particularly for me - my lesson here is to read the actual error message!
November 8, 2023 at 8:17 pm
Great question, Steve. It gave me an idea for something else that I need to do.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply