Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
1| Name | Data Type | Length | Description |
|---|---|---|---|
| @user_id | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
/*
[user_login_access] 41904867
[user_login_access] 94437923
*/
CREATE OR ALTER PROCEDURE dbo.user_login_access
-- Add the parameters for the stored procedure here
@user_id int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT service_id
FROM users_acl
WHERE user_id = @user_id
UNION
SELECT ga.service_id
FROM groups_acl ga INNER JOIN users_by_group ug
ON ga.group_id = ug.group_id
WHERE ug.user_id = @user_id
GROUP BY ga.service_id
END
GO
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
/*
[user_login_access] 41904867
[user_login_access] 94437923
*/
CREATE OR ALTER PROCEDURE dbo.user_login_access
-- Add the parameters for the stored procedure here
@user_id int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT service_id
FROM users_acl
WHERE user_id = @user_id
UNION
SELECT ga.service_id
FROM groups_acl ga INNER JOIN users_by_group ug
ON ga.group_id = ug.group_id
WHERE ug.user_id = @user_id
GROUP BY ga.service_id
END
GO
Depends On
3Used By
No items found