Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
1| Name | Data Type | Length | Description |
|---|---|---|---|
| @p_cliente | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec [cliente_usuarios_productos] 2254875
*/
CREATE OR ALTER PROCEDURE dbo.cliente_usuarios_productos
@p_cliente int
AS
BEGIN
SET NOCOUNT ON;
declare @cli_codigo int = (select cli_codigo from clientes where cliente = @p_cliente)
select distinct users.user_id as id , username, isnull(first_name,'') + ' ' + isnull(last_name,'') as nombre, usuarios_productos.id_producto as producto
from users
inner join usuarios_productos on usuarios_productos.user_id = users.user_id
where cli_codigo = @cli_codigo or cliente = @p_cliente
and isnull(active_user,'Y') = 'Y'
END
GO
GO
/*
exec [cliente_usuarios_productos] 2254875
*/
CREATE OR ALTER PROCEDURE dbo.cliente_usuarios_productos
@p_cliente int
AS
BEGIN
SET NOCOUNT ON;
declare @cli_codigo int = (select cli_codigo from clientes where cliente = @p_cliente)
select distinct users.user_id as id , username, isnull(first_name,'') + ' ' + isnull(last_name,'') as nombre, usuarios_productos.id_producto as producto
from users
inner join usuarios_productos on usuarios_productos.user_id = users.user_id
where cli_codigo = @cli_codigo or cliente = @p_cliente
and isnull(active_user,'Y') = 'Y'
END
GO
Depends On
3Used By
No items found