I\'m looking for a way for retrieving Entity Data Model (EDM) from __MigrationHistory table using only T-SQL (so anyone, using Microsoft SQL Se
Finally found this article:
https://social.technet.microsoft.com/wiki/contents/articles/36388.transact-sql-convert-varbinary-to-base64-string-and-vice-versa.aspx#Convert_VARBINARY_to_Base64_String
So, running the query gets what I wanted, valid Base64.
Using XML and the hint "for xml path"
select Model, baze64
from __MigrationHistory
cross apply (select Model as '*' for xml path('')) T (baze64)

Other presented queries in article will also work
Using XML XQuery

Using JSON
