Hello, I have a column that is not auto-incremented. I would like to make it auto-incremented. For the moment, the only solution I found is to delete my column and to add a new auto-incremented column. The problem is I cannot delete it without deleting dependencies on it... So is there a solution to make an existing column auto-incremented or is it necessary to a create a new column ?
If you do this from Enterprise Manager it will do all the dependencies stuff for you (if required). Just try opening the table in design view and changing the IDENTITY property and see what happens (obviously backup before trying this...)
OK then. I would: -script out your dependencies -delete the dependencies -create a new temporary table of identical structure but has your column as an IDENTITY -copy across your data -delete the existing table -rename the temporary table back to the original name
This is basically what Enterprise Manager does when you try and change a column to an IDENTITY column. You could also add a new IDENTITY column (provided your table doesn't already have one), but I suspect that you'll have to modify the dependant code to point to the new column.