I have a MySQL database that I am migrating to SQL Server. The application that references the database breaks when I run it against SQL Server because SQL Server does not offer the implicit defaults that MySQL offers.
I wanted to see if there is a way to generate script that would force defaults on all NOT Null columns that do not have a default specified. This way I can mimic MySQL's implicit defaults using explicit defaults in SQL Server
try something like this. this will generate some SQL that you can run to add the missing defaults. So run this and then take the output and run that to actually add the defaults. Also, you may want to tweak what I set as the defaults in the CASE: