dbo.backend_datos_clientes_comentarios

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
/****** Object:  StoredProcedure [dbo].[backend_datos_clientes]    Script Date: 6/7/2017 11:35:12 ******/

/*
CREATE TABLE [dbo].[clientes_comentarios](
cliente int null, 
comentarios varchar(max) null,
user_id int NULL,
created smalldatetime null

) ON [PRIMARY]

select * from users where username = 'f0000'
select * from clientes_comentarios
insert into clientes_comentarios values (103974506, 'Se volvio a llamar por telefono en el dia de hoy, para ofrecer nuevos servicios', 1063064806, GETDATE())

*/


CREATE OR ALTER PROCEDURE dbo.backend_datos_clientes_comentarios
@p_Cliente int 
AS
BEGIN
 
    SET NOCOUNT ON;
 begin
 
  select /*a.created as fecha,*/ FORMAT (a.created, 'dd-MM-yyyy HH:mm') as fecha,
         b.username, 
      a.comentarios,
      replace(a.comentarios,char(10),'<br>') as comentarios_mostrar
      from clientes_comentarios a

   left join users b
     on b.user_id = a.user_id
       
   where a.cliente  = @p_cliente

  order by fecha desc 
          
 end

END

GO

Used By

No items found