Hello
I' ve problems with the instruction Create Table #TableName, because days
ago I was run store procedures with this instruction and i don't problems.
the result is ok!.
I don' t know now why i can't run this stores...
Not exists alteration in nothing with respect to Data Base.. no new fields,
nothing.
Thanks and regards
PD: When I use Declare @.tableName Table, all is ok. WHY?, I need use
#TableName because I use "Execute('Senteces')" and "Sentences" is a string
concatenate . I like know why?
Can you define "problems"? Can you show the code, and what happens (e.g.
the error message)?
http://www.aspfaq.com/
(Reverse address to reply.)
"Table, Declare Table, Create table, SP" <Table, Declare Table, Create
table, SP@.discussions.microsoft.com> wrote in message
news:0C7AB68F-3102-4EB9-B74A-D9626B2FE45F@.microsoft.com...
> Hello
> I' ve problems with the instruction Create Table #TableName, because days
> ago I was run store procedures with this instruction and i don't problems.
> the result is ok!.
> I don' t know now why i can't run this stores...
> Not exists alteration in nothing with respect to Data Base.. no new
fields,
> nothing.
> Thanks and regards
> PD: When I use Declare @.tableName Table, all is ok. WHY?, I need use
> #TableName because I use "Execute('Senteces')" and "Sentences" is a
string
> concatenate . I like know why?
|||Before :
Create table #tmp_Articulos_Vencidos
(cod_Articulovarchar(20)COLLATE Modern_Spanish_CI_AS,
Saldo_Lote decimal(15,5)
)
insert into #tmp_Articulos_Vencidos
SelectArt.Cod_Articulo_Auxas cod_Articulo,
cast(sum(isnull(TEAL.num_stock_saldo_lote,0)) as decimal(15,5)) as Saldo_Lote
Fromtab_existencias_almacenas teawith (nolock)
Jointab_Articuloas Artwith (nolock)
OnArt.Cod_Catalogo= Tea.Cod_Catalogo
AndArt.Cod_Articulo= Tea.Cod_Articulo
AndArt.fla_reg_lote= 'S'
Left
jointab_existencias_almacen_loteas TEALwith (nolock)
OnTEAL.Cod_Pais= Tea.Cod_Pais
AndTEAL.Cod_Almacen= Tea.Cod_Almacen
AndTEAL.Cod_Articulo= Tea.Cod_Articulo
AndTEAL.Cod_Catalogo= Tea.Cod_Catalogo
Where
Tea.Cod_pais= @.Cod_pais
andAlm.Cod_Terra= @.Cod_Terra
Group by
Art.Cod_Articulo_Aux,
teal.fec_vencimiento
-- -*-*-*-*-*-*-*-*-*-*-*
-- Show results
-- -*-*-*-*-*-*-*-*-*-*-*
Execute('Select cod_Articuloas [Código], ' +
'Saldo_loteas [Stock] ' +
'From#tmp_Articulos_Vencidos ' +
'Where (1=1) ' +
'Order by 2 ' )
drop table #tmp_Articulos_Vencidos
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
After :
SelectArt.Cod_Articulo_Auxas cod_Articulo,
cast(sum(isnull(TEAL.num_stock_saldo_lote,0)) as decimal(15,5)) as Saldo_Lote
INTO #tmp_Articulos_Vencidos
Fromtab_existencias_almacenas teawith (nolock)
Jointab_Articuloas Artwith (nolock)
OnArt.Cod_Catalogo= Tea.Cod_Catalogo
AndArt.Cod_Articulo= Tea.Cod_Articulo
AndArt.fla_reg_lote= 'S'
Left
jointab_existencias_almacen_loteas TEALwith (nolock)
OnTEAL.Cod_Pais= Tea.Cod_Pais
AndTEAL.Cod_Almacen= Tea.Cod_Almacen
AndTEAL.Cod_Articulo= Tea.Cod_Articulo
AndTEAL.Cod_Catalogo= Tea.Cod_Catalogo
Where
Tea.Cod_pais= @.Cod_pais
andAlm.Cod_Terra= @.Cod_Terra
Group by
Art.Cod_Articulo_Aux,
teal.fec_vencimiento
-- -*-*-*-*-*-*-*-*-*-*-*
-- Show results
-- -*-*-*-*-*-*-*-*-*-*-*
Execute('Select cod_Articuloas [Código], ' +
'Saldo_loteas [Stock] ' +
'From#tmp_Articulos_Vencidos ' +
'Where (1=1) ' +
'Order by 2 ' )
drop table #tmp_Articulos_Vencidos
QUESTION : ????
Why ?, before it success ok. and now NOT...
thanks
"Aaron [SQL Server MVP]" wrote:
> Can you define "problems"? Can you show the code, and what happens (e.g.
> the error message)?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Table, Declare Table, Create table, SP" <Table, Declare Table, Create
> table, SP@.discussions.microsoft.com> wrote in message
> news:0C7AB68F-3102-4EB9-B74A-D9626B2FE45F@.microsoft.com...
> fields,
> string
>
>
|||> Why ?, before it success ok. and now NOT...
What does this mean? Do you get an error message? If so, what is it? If
not, what does "success NOT" mean?
No comments:
Post a Comment