reconfigure with override
go
declare @sid varbinary(85)
select @sid = sid from master.dbo.syslogins
where loginname = 'sa'
update master.dbo.sysdatabases
set sid = @sid
where dbid = db_id()
exec sp_configure 'allow', 0
reconfigure with override