Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DECLARE @UserId INT
DECLARE @ApplicationId INT
DECLARE @RoleId INT

SET @ApplicationId = 3
SET @RoleId = (SELECT AR.ID FROM [Common].[ApplicationRoles] as AR WHERE AR.AppID = 3 AND AR.Name = N'Admin')
SET @UserId = (SELECT TOP 1 US.ID FROM [Common].[Users] as US WHERE US.UserName <> N'ServiceUser' AND US.Active = 1 AND US.UserType = N'U')

INSERT INTO [Common].[ApplicationUsers] ([UserID],[ApplicationID]) VALUES (@UserId,@ApplicationId)
INSERT INTO [Common].[ApplicationUserRoles]([UserID],[AppID],[RoleID]) VALUES (@UserId ,@ApplicationId , @RoleId)


Scroll pdf ignore
SQL Enterprise Job Manager monitors and manages your SQL Server agent jobs. Learn more > >

Scroll Pagebreak