Respuesta: problemas con datos tipo tinyint Porque tienes un 'select insert'??? si quieres hacer un insert dinamico tienes que poner tus valores en una variable asi: set @query=INSERT INTO [SNT_CONTAB].[dbo].[C01Trans] ([KeyEntry],[siPeriod],[ID_Entry],[Id_Trans],[Nline],[ID_Account],[ID_Document],[dtDate],[siMonth],[Reference],[dtDateTrc],[Detail],[ID_Class],[Amount],[Cr],[TaxBase]) Values
('+convert(varchar,ISNULL(@KeyEntry,''))+','+conve rt(varchar,ISNULL(@siPeriod,''))+','+convert(varch ar,ISNULL(@ID_Entry,''))+','+'1'+','+'1'+','+'4135 05'+','+convert(varchar,ISNULL(@nrofactura,''))+', '+convert(varchar,ISNULL(@siPeriod,''))+'+'+ISNULL (@MesConsol,'')+'+'+ISNULL(@DiaConsol_F,'')+','+IS NULL(@Mes_Comprob,'')+','+ISNULL(@nrofactura,'')+' ,'+ISNULL(@Fechafac,'')+','+'VENTA 16% '+'+'+convert(varchar,ISNULL(@NomClie,''))+'+'+' Factura '+'+'+convert(varchar,ISNULL(@nrofactura,''))+','+ convert(varchar,ISNULL(@ID_Class,''))+','+convert( varchar,ISNULL(@Base_Iva16Fac,''))+','+'-1'+','+'0'+')'
exec Sp_sqlExec @query
Saludos!!
__________________ What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me |