I need help to generate a script that allows me to execute an action in this case a GRANT
, the example I have is the following:
select 'GRANT insert, select, delete, update on '+ name + ' TO
bodeguero' from BODEGA.sys.tables
in which way I can execute this query automatically, as this query returns me:
grant insert, select, delete, update on BOD_CABEZATOMA to bodeguero
grant insert, select, delete, update on BOD_CAB_EGRESO_BODEGA to bodeguero
grant insert, select, delete, update on BOD_CAB_INGRESO_BODEGA to bodeguero
grant insert, select, delete, update on BOD_DETALLEEGRESO to bodeguero
Thanks in advance