USE dbFoo;
GO;
EXEC
sp_changedbowner 'sa'
GO;
ALTER DATABASE dbFoo
SET TRUSTWORTHY ON;
GO;
USE MASTER;
GO;
GRANT EXTERNAL
ACCESS ASSEMBLY TO [domain\userBar]; -- note: server-wide
GO;
USE dbFoo;
GO;
sp_configure 'show advanced options',
1;
GO;
RECONFIGURE WITH OVERRIDE;
GO;
sp_configure 'clr enabled', 1;
GO;
RECONFIGURE WITH OVERRIDE;
GO;