Sql2000 scripts

Unique for SQL 2000:
Determine what access a particular userId has…
declare @name varchar(200)
set @name = ‘pfeduser’
SELECT sp.grantee, so.name, sptcts.protecttype, sptcts.action, su.name
FROM syspermissions sp, sysobjects so, sysprotects sptcts, sysusers su
WHERE su.name = @name and su.uid = sp.grantee and so.id = sp.id and sptcts.uid = sp.grantee and so.id = sptcts.id

Leave a Reply...Really! I'll listen!