I decided to break this into two roles, working on the basic access first and have the following issue, but not sure why the code is creating this:
The last object is not getting its full name, is there a limit on what gets printed? There are 284 views, and only 47 are getting returned.. I am running in ssms window, testing before I put into a stored proc.
-----
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql = @sql + 'GRANT SELECT ON ' + QUOTENAME(OBJECT_SCHEMA_NAME(object_id)) + N'.' + QUOTENAME(name) + ' TO [ro_ZemeterNet_Access];
'
FROM sys.views
WHERE name LIKE 'zvw%';
PRINT @sql;
------
GRANT SELECT ON [dbo].[zvw_QTZ_dummy_customers] TO [ro_ZemeterNet_Access];
GRANT SELECT ON [dbo].[zvw_Daily_Fcst_Curre