- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 05:00 AM
How can we alter table with auto increment column for a delta table
I have tried this but not working:
ALTER TABLE dbgtpTest.student ADD COLUMN Student_Id identity(100,1)
any Suggestions will be helpful
- Labels:
-
Alter table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:28 PM
@Rakesh Reddy Badam , I am not sure if that is supported. I only find references to creating an ID column with the CREATE TABLE statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2022 04:11 AM
@Rakesh Reddy Badam , For ALTER ... ADD COLUMN in doc is only SYNC IDENTITY.
If you want to add an identity column to the existing table just create a new table with an identity column and then copy the data.
My blog: https://databrickster.medium.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2022 08:13 PM
Hi, I have the same concern. What's the best way to achieve this?