Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Redo the queries using SSRS. For every database/schema, list all table with audit table. USE BOOK; SELECT table_name = t.name, schema_name = s.name FROM sys.tables

Redo the queries using SSRS.

  1. For every database/schema, list all table with audit table.


USE BOOK;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE COMPANY;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE DGDB;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE OES2;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE PROP;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE SP;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

USE ZEOTA;

SELECT table_name = t.name, schema_name = s.name

FROM sys.tables t

INNER JOIN sys.schemas s ON t.schema_id = s.schema_id

WHERE t.name LIKE '%audit%';

2. For every database/schema, list schema, users, role, dept

SELECT schema_name = name

FROM sys.schemas;

SELECT user_name = name

FROM sys.database_principals

WHERE type_desc = 'SQL_USER';

SELECT role_name = name

FROM sys.database_principals

WHERE type_desc = 'DATABASE_ROLE';

SELECT department_name = name

FROM sys.schemas;

3. For every database/schema, list schema equipped with triggers to manage change in users.

SELECT DISTINCT OBJECT_SCHEMA_NAME(parent_id) AS schema_name

FROM sys.triggers

WHERE OBJECT_NAME(parent_id) LIKE '%user%';

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Programming questions