I had trouble upgrading from 4.9.4 to 5.1.2 - in the upgrade log it would say:
00:00:00.046 - Upgrading to Version: 05.01.02 00:00:00.375 - Executing Script: 05.00.00.SqlDataProvider Error! (see 05.00.00.log for more information) 00:00:06.593 - Executing Script: 05.00.01.SqlDataProvider Error! (see 05.00.01.log for more information)
00:00:07.671 - Executing Script: 05.01.00.SqlDataProvider Error! (see 05.01.00.log for more information)
00:00:10.468 - Executing Script: 05.01.01.SqlDataProvider Error! (see 05.01.01.log for more information)
00:00:11.375 - Executing Script: 05.01.02.SqlDataProvider Error! (see 05.01.02.log for more information)
I went and checked the log to see what it said (in the dnn folder - providers/database or something like that) the log would say:
System.Data.SqlClient.SqlException: Cannot find the object 'NTForums_GetForumsByGroup2', because it does not exist or you do not have permission.
and then there would be the same line repeated over and over about granting and revoke rights on sys admin or something.
Anyways, I went and looked at the stored procedures in the database and sure enough, all the way at the bottom was a stored procedure with a qualifier in front of it that made it sort all the way at the bottom - even though i do not use qualifyers. The sp was called exactly what the error said - NTForums_GetForumsByGroup2 - except with a qualifyer in front. No idea what it was doing there. Deleted it and then instalation went smoothly - though I am having trouble with the login - maybe skin related.
Also, when I did the upgrade that had the error in it, it also had an error with the html module - so when I went to the site after the upgrade, all the modules that were html modules were throwing errors. Deleting the NTForums_GetForumsByGroup2 sp also made it so when it did the upgrade the html module did not error.
Hope this helps!