• works great with the function as was posted.

    I just added double quotes on the line #92:

    set @s-2 = @protect_type_name + ' ' + @action_name + ' ON ' + @object_name + ' TO "' + @to_user + '"'

    to support "DOMAIN\user" format.

    thanks.

    Roberto Figueroa.