79179166

Date: 2024-11-11 21:25:13
Score: 1
Natty:
Report link

Kind of late to the party here but I needed to do this today:

ADO pipeline makes it almost too easy. Treat this just like a powershell or AZcli script. Create a pipeline var & call it with $(var)

IF EXISTS (SELECT * FROM sys.database_principals WHERE name = '$(client)_user')
    BEGIN
    Print '$(client)_user already exists.  Dropping to reinitialize'
    DROP USER [$(client)_user]
    END

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dan