MSSQL modifyDatatype on Indexcolumns

Hi guys,

I’m trying to create a customchange that modifies datatypes on a mssql database where indexes and/or primarykeys are involved.

Reason: On mssql its not possible to change a columns datatype while there is an active index/pk on that column

So basically a customchange that does the following:

  • lookup the indexname+options and create ddl for drop/create
  • drop the index
  • modify the datatype
  • create the index

(changesetoptions would be schemaname, tablename, columnname, newdatatype)

I’d be gratefully for any input on this topic. Maybe anyone has already done this?! :wink: