• Thanks for sharing Warren. If this is to be used on SQL2005 and above you really need to be switching to 'create user' syntax rather than sp_grantdbaccess, else the user will be probably be created with the incorrect default schema.

    ---------------------------------------------------------------------