on 07-04-2013 12:13 AM
Buenas tardes he realizado un PostransactionNotice en una base de datos y esta me funciona excelente pero trato de ejecutar el mismo codigo en otra base de datos y no pasa nada, es necesario activar algo para que funcione?
USE [XXXXXX]
GO
/****** Object: StoredProcedure [dbo].[SBO_SP_PostTransactionNotice_GB_PAGOS_EFECTUADOS] Script Date: 07/03/2013 17:09:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SBO_SP_PostTransactionNotice_GB_PAGOS_EFECTUADOS]
@object_type nvarchar(20), -- SBO Object Type
@transaction_type nchar(1), -- [A]dd, [U]pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255),
@error INT OUTPUT,
@error_message nvarchar (200) Output
AS
begin
-- Return values
select @error = 0
select @error_message = N'Ok'
/*********************************************/
/*** DECLARACION DE VARIABLES Y CONSTANTES ***/
/*********************************************/
Declare @Tipo VarChar(1) -- Guarda el Tipo de Pago Efectuado (A Proveedor, A Cliente, A Cuenta)
declare @comentarios as nvarchar(10)
select @comentarios= xxs.comments from OVPM xxs where Docnum = convert(Int,@list_of_cols_val_tab_del)
declare @valorchequecausal as nvarchar(84)
set @valorchequecausal=(select replace(valor,'</id>',',')as Facturas from(
SELECT top 1 replace(node.text,'<id>','')as valor
FROM (
--select distinct o.U_DoctoSerie+'-'+ISNULL(o.U_DoCTONO,o.DOCNUM) as id from vpm2 p
select distinct isnull(o.U_DoctoSerie,'') +'-'+ cast(ISNULL(o.U_DoCTONO,o.DOCNUM) as nvarchar(100)) as id from vpm2 p
inner join Opch o on o.DocEntry=p.DocEntry
where p.Docnum = convert(Int,@list_of_cols_val_tab_del)
) AS a
CROSS APPLY(
-- select distinct o.U_DoctoSerie +'-'+ ISNULL(o.U_DoCTONO,o.DOCNUM) as id from vpm2 p
select distinct isnull(o.U_DoctoSerie,'') +'-'+ cast(ISNULL(o.U_DoCTONO,o.DOCNUM) as nvarchar(100)) as id from vpm2 p
inner join Opch o on o.DocEntry=p.DocEntry
where p.Docnum = convert(Int,@list_of_cols_val_tab_del)
FOR XML PATH('')
) AS node(text)
)x)
declare @valorcomentarios as nvarchar(84)
set @valorcomentarios=(select comments from ovpm where Docnum = convert(Int,@list_of_cols_val_tab_del))
if @valorchequecausal is null
update OVPM set U_causacheque= @valorcomentarios
where Docnum = convert(Int,@list_of_cols_val_tab_del)
else
update OVPM set U_causacheque= 'Pago de facturas:' +' '+ @valorchequecausal
where Docnum = convert(Int,@list_of_cols_val_tab_del)
/***********************************************************************************************************************************************/
FIN:
end
El problema era que el TN llamaba otro SP que no tenia jjejeje muchas gracias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Carlos,
Debe cambiar la línea altera para crear si no hay una base.
ALTER PROCEDURE [dbo].[SBO_SP_PostTransactionNotice_GB_PAGOS_EFECTUADOS]
CREATE PROCEDURE [dbo].[SBO_SP_PostTransactionNotice_GB_PAGOS_EFECTUADOS]
Saludos,
Marcelo Silva Santos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.