This applies an alternate version of the parent commit to the MSSQL script. Thanks to Guzzi for the fix.
On systems where there are channels in the database that don't have any tuning details, the SQL script failed to execute. This is due to the column being declared NOT NULL, but the subquery not returning any channel number for these rows. Because the database upgrade fails, starting SetupTv and/or the TvService is impossible and the TvEngine is unusable. The script for SQL Server still needs to be fixed.
Fix by catavolt, thanks!
…se_on_fresh_installation' of http://github.com/MediaPortal/MediaPortal-1 into BUG-4216-MP_has_problems_accessing_the_tv_server_database_on_fresh_installation