我有这个查询
SELECT 'GRANT SELECT ON ' + TABLE_NAME + ' TO '+ @UserName
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND
TABLE_NAME LIKE 'aspnet%'
结果如下:
GRANT SELECT ON aspnet_Applications TO user04
GRANT SELECT ON aspnet_Membership TO user04
GRANT SELECT ON aspnet_Paths TO user04
GRANT SELECT ON aspnet_PersonalizationAllUsers TO user04
GRANT SELECT ON aspnet_PersonalizationPerUser TO user04
GRANT SELECT ON aspnet_Profile TO user04
GRANT SELECT ON aspnet_Roles TO user04
GRANT SELECT ON aspnet_SchemaVersions TO user04
我想在这个结果中运行所有的选择查询。我怎样才能做到这一点?