If you use Entity Frameworks migrations, you can issue an SQL query like this in the Up method for migration, which adds a sparse column:
Sql("alter table TableName alter column ColumnName int sparse");
Even if you do not use migrations, any single execution of dbContext.Database.ExecuteSqlCommand
with the same SQL will work.
None of the methods are as good as if you could explicitly configure the type through EF, but they are still better than deleting and replacing the entire table.
source share