Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8771655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:50:43+00:00 2026-06-13T17:50:43+00:00

I have a table which includes an identity column but i cant remove the

  • 0

I have a table which includes an identity column but i cant remove the identity property.

Is there a way to disable it? Or a way to make a copy of the entire table without identity property?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:50:44+00:00Added an answer on June 13, 2026 at 5:50 pm

    Note that you may not be able to drop the column if it referenced by a clustered index, and you can’t drop all clustered indexes for a table because SqlAzure tables must always have a clustered index.

    This means that you may have to jump through the following hoops (for at least your last clustered index, which may well be your primary key):

    • rename your clustered index
    • create a temp version of the table (with a new clustered index)
    • copy the data from the current table
    • drop the current table
    • rename the temp table to the current name

    This roughly looks like this:

    -- Rename clustered index
    EXECUTE sp_rename N'PK_My_Current_PK', N'PK_My_Current_PK_OLD',  'OBJECT'
    
    -- If you have any FK constraints on the table, then drop them
    ALTER TABLE dbo.MyTable DROP CONSTRAINT FK_My_Foreign_Key
    
    -- Create the new version of your table - because this is SQLAzure it must have a clustered index
    CREATE TABLE dbo.tmp_MyTable (
        MyID int NOT NULL,
        CONSTRAINT PK_My_Current_PK PRIMARY KEY CLUSTERED (MyID)
    )
    
    -- Copy the data into the temp table from the old table
    INSERT INTO dbo.tmp_MyTable (MyID)
        SELECT MyID FROM dbo.MyTable 
    
    -- Drop the old table 
    DROP TABLE dbo.MyTable 
    
    -- Rename the new table
    EXECUTE sp_rename N'tmp_MyTable', N'MyTable', 'OBJECT' 
    
    -- Recreate any foreign key constraints
    ALTER TABLE dbo.MyTable WITH CHECK ADD FK_My_Foreign_Key FOREIGN KEY (MyID)
        REFERENCES dbo.MyForeignTable (MyID)
    

    Hope that helps

    A

    Edit: As @PhilBolduc pointed out SqlAzure tables require a clustered index, not a primary key. I’ve amended the terminology above accordingly – the principle of the answer still remains.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of names and addresses, which includes a postcode column. I
I have a table which includes an integer type column named sequence, which does
I have daily scheduled task that queries a table which includes column named AttemptDate
I have a comments table which includes a column for user_id I have the
So I have a mySQL database with a 'users' table which includes a username,
I have table in which I am inserting rows for employee but next time
i have a table which has many fields but i want to get count
I have a table in the database which includes all active users. I then
I have an ORACLE table which includes the following fields: FieldA1 NUMBER(10,0) FieldA2 VARCHAR2(40
I have a table called prices which includes the closing price of stocks that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.