Gosh. This is a long time ago.
I'd forgotten all about this until I got an email from smorgan just now. And I can barely remember anything about it, so my starting point is not that much different from you guys.
I did quite a bit of digging but didn't find much which is directly useful.
I can't be sure, but I think this article might now be a link for the one referred to:http://www.sqlservercentral.com/articles/Security/sqlpermissionspublicrole/116/
Given that, I think the f_lookup_system_id function probably looked something like this (this is a guess, but it should at least give the idea):
create function dbo.f_lookup_system_id(@name varchar(50), @id int) returns varchar(50) as
select dbo.f_lookup_system_id('sysprotects_protecttype', 206)
select dbo.f_lookup_system_id('sysprotects_action', 197)
declare @s varchar(50)
if @name = 'sysprotects_protecttype'
select @s =
when 204 then 'GRANT_W_GRANT'
when 205 then 'GRANT'
when 206 then 'REVOKE'
if @name = 'sysprotects_action'
select @s =
when 26 then 'REFERENCES'
when 178 then 'CREATE FUNCTION'
when 193 then 'SELECT'
when 195 then 'INSERT'
when 196 then 'DELETE'
when 197 then 'UPDATE'
when 198 then 'CREATE TABLE'
when 203 then 'CREATE DATABASE'
when 207 then 'CREATE VIEW'
when 222 then 'CREATE PROCEDURE'
when 224 then 'EXECUTE'
when 228 then 'BACKUP DATABASE'
when 233 then 'CREATE DEFAULT'
when 235 then 'BACKUP LOG'
when 236 then 'CREATE RULE'
Sorry I can't be more helpful.
If you manage to get anything useful out of this, please let us know!
Solutions are easy. Understanding the problem, now, that's the hard part.