Home Forums SQL Server 2014 Administration - SQL Server 2014 Please help to fix this query for listing object permissions for all dbs in an instance RE: Please help to fix this query for listing object permissions for all dbs in an instance

  • sp_MSforeachDB does not automatically change the context to each database, so it executes in the context of the database where you originally run the query. Preface your dynamic SQL with USE [?].

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA