Hi
I want to alter a column of a table to change its default setup value, however, it is the index field, I would like to know what should I pay attention before making the change ?
Thanks
Keep in mind that changing the default value won't affect any existing data (only new INSERT's that don't include a value for the column in question). So the index shouldn't be an issue one way or the other. But you might check the Sybase doc's to see for sure if this is a case where the table will actually be copied to create a new one with the new default--I doubt that it is.
You can avoid using ALTER TABLE and just use sp_unbindefault and then sp_bindefault to (respectively) remove the old default and bind on the new one. This won't affect your index or copy data. To do this, you'll have to have the new default defined (see CREATE DEFAULT), but I think the ALTER TABLE will just do all that for you internally.
So, I did change the value of the column, but when try to add a new record, the old value keeps displaying instead of new one. Should I recycle the database after changing the structure ? (version 11.5.1.2)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.