#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Posts
    11
    Rep Power
    0

    How to delete identity column?


    Hi
    I have in issue in MSSQL 2014 table. In my Project, I have lots of table(136)

    Now I need to delete the identity column 'SNo' When I used normal command 'ALTER TABLE AD_FGMaster DROP COLUMN SNo '

    Error is "The object 'PK_AD_FGMaster' is dependent on column 'SNo'.

    Because it is tied up to so many View. It is difficult to find.
    Is there any way drop the column in table as well as in view also?

    Pls advice me.

    Thank you
    maideen
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    6
    Rep Power
    0
    Hi maideen,

    You can drop the references to that column, then drop the column

    But this will corrupt the database integrity
    What is the reason for you to drop the identity column with referencing tables?

IMN logo majestic logo threadwatch logo seochat tools logo