added files from swmgmt03

This commit is contained in:
Schork Thierry (Galenica - ADM)
2025-09-22 09:00:00 +02:00
parent de97031b1e
commit 63d058a7eb
67 changed files with 13300 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
use UeberpruefungBAG2024
-- Replace 'username' with the actual username
DECLARE @username NVARCHAR(128) = 'E-MEDIAT\uapvi';
-- Find schemas owned by the user
SELECT schema_name(schema_id) AS SchemaName
FROM sys.schemas
WHERE principal_id = USER_ID(@username);
-- Find objects owned by the user
SELECT
o.name AS ObjectName,
o.type_desc AS ObjectType,
s.name AS SchemaName
FROM
sys.objects o
JOIN
sys.schemas s ON o.schema_id = s.schema_id
WHERE
o.principal_id = USER_ID(@username);
GO
return
ALTER AUTHORIZATION ON SCHEMA::[db_owner] TO [dbo];