Muy buenas copia este query en el analizador de consultas de SQL Server donde dice JPINZON pones el nombre de la cuenta de inicio de sesion de ACTIVE DIRECTORY y lo corres...
a mi me sirvio...
saludos...
/* Rutina creada GRANT TABLE USER -- 30 de septiembre del 2002 -- UP */
declare @name as varchar(255)
declare @owner as varchar(255)
declare @usuario as varchar(255)
set @usuario = '
JPINZON'
exec (' GRANT ALL TO ['+ @usuario + '] ')
declare tablas cursor local for select name, uid from sysobjects where OBJECTPROPERTY ( sysobjects.id ,'ISUSERTABLE') = 1 and OBJECTPROPERTY ( sysobjects.id ,'OwnerId') = user_id('dbo') order by name
OPEN tablas
FETCH tablas INTO @name, @owner
print '<< TABLAS >>'
while @@fetch_status = 0
begin
print @name + ', ' + @owner
exec (' GRANT SELECT, INSERT, UPDATE, DELETE ON [' + @name + '] to ['+ @usuario + ']')
FETCH tablas INTO @name, @owner
end
CLOSE tablas
DEALLOCATE tablas
print ' '
print ' '
declare vistas cursor local for select name, uid from sysobjects where OBJECTPROPERTY ( sysobjects.id ,'IsView') = 1 and OBJECTPROPERTY ( sysobjects.id ,'OwnerId') = user_id('dbo') order by name
OPEN vistas
FETCH vistas INTO @name, @owner
print '<< VISTAS >>'
while @@fetch_status = 0
begin
print @name + ', ' + @owner
exec (' GRANT SELECT, INSERT, UPDATE, DELETE ON [' + @name + '] to ['+ @usuario + ']')
FETCH vistas INTO @name, @owner
end
CLOSE vistas
print ' '
print ' '
DEALLOCATE vistas
declare procedimientos cursor local for select name, uid from sysobjects where OBJECTPROPERTY ( sysobjects.id ,'IsProcedure') = 1 and OBJECTPROPERTY ( sysobjects.id ,'OwnerId') = user_id('dbo') order by name
OPEN procedimientos
FETCH procedimientos INTO @name, @owner
print '<< PROCEDIMIENTOS >>'
while @@fetch_status = 0
begin
print @name + ', ' + @owner
exec (' GRANT EXECUTE ON [' + @name + '] to ['+ @usuario + ']')
FETCH procedimientos INTO @name, @owner
end
CLOSE procedimientos
print ' '
print ' '
DEALLOCATE procedimientos
declare funcionescalar cursor local for select name, uid from sysobjects where OBJECTPROPERTY ( sysobjects.id ,'IsScalarFunction') = 1 and OBJECTPROPERTY ( sysobjects.id ,'OwnerId') = user_id('dbo') order by name
OPEN funcionescalar
FETCH funcionescalar INTO @name, @owner
print '<< FUNCIONES >>'
while @@fetch_status = 0
begin
print @name + ', ' + @owner
exec (' GRANT EXECUTE ON [' + @name + '] to ['+ @usuario + ']')
FETCH funcionescalar INTO @name, @owner
end
CLOSE funcionescalar
print ' '
print ' '
DEALLOCATE funcionescalar
declare funcionestable cursor local for select name, uid from sysobjects where OBJECTPROPERTY ( sysobjects.id ,'IsTableFunction') = 1 and OBJECTPROPERTY ( sysobjects.id ,'OwnerId') = user_id('dbo') order by name
OPEN funcionestable
FETCH funcionestable INTO @name, @owner
print '<< FUNCIONES >>'
while @@fetch_status = 0
begin
print @name + ', ' + @owner
exec (' GRANT SELECT, INSERT, UPDATE, DELETE ON [' + @name + '] to ['+ @usuario + ']')
FETCH funcionestable INTO @name, @owner
end
CLOSE funcionestable
print ' '
print ' '
DEALLOCATE funcionestable