-- master key in master database
USE master
go

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'StrongPassword1'
go

-- keyfile generated by VS or .NET command line utilities
-- this is the keyfile that the assembly is signed with
CREATE ASYMMETRIC KEY assm FROM FILE='c:\temp\assm.snk'
GO

CREATE LOGIN snk FROM ASYMMETRIC KEY assm
GO
-- this is in the master database
GRANT UNSAFE ASSEMBLY TO snk
GO

USE pubs
GO

CREATE ASSEMBLY unsafeassemblyex FROM 'c:\temp\unsafe1.dll'
  WITH PERMISSION_SET = UNSAFE
GO
