• Hello laurie,

    thank you very much for your advice!

    TallyTable is really a nice thing to know and use.

    Just tried your corrected code

    The 'ON' got lost in my 2nd example, i included it like

    SET @commandString =

    'INSERT INTO #tmpTab SELECT ''' +@command + ' ON '' + SCHEMA_NAME(schema_id) + ''.'' + [name] + '' TO ' +@user+

    ''' FROM sys.objects

    WHERE [type] IN ( '+@par+' ) AND is_ms_shipped = 0;'

    now it does exactly what I want!

    The procedure is not called "Permissions" in original (it is called "Rechte")..I just called it that way in the forum to have everything in english to keep the flow for everyone, but still its good you tell me.

    schema-names you mean to add this [dbo] in front of every object?