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_Articulo varchar(20) COLLATE Modern_Spanish_CI_AS,
Saldo_Lote decimal(15,5)
)
insert into #tmp_Articulos_Vencidos
Select Art.Cod_Articulo_Aux as cod_Articulo,
cast(sum(isnull(TEAL.num_stock_saldo_lote,0)) as decimal(15,5)) as Saldo_Lote
From tab_existencias_almacen as tea with (nolock)
Join tab_Articulo as Art with (nolock)
On Art.Cod_Catalogo = Tea.Cod_Catalogo
And Art.Cod_Articulo = Tea.Cod_Articulo
And Art.fla_reg_lote = 'S'
Left
join tab_existencias_almacen_lote as TEAL with (nolock)
On TEAL.Cod_Pais = Tea.Cod_Pais
And TEAL.Cod_Almacen = Tea.Cod_Almacen
And TEAL.Cod_Articulo = Tea.Cod_Articulo
And TEAL.Cod_Catalogo = Tea.Cod_Catalogo
Where
Tea.Cod_pais = @.Cod_pais
and Alm.Cod_Terra = @.Cod_Terra
Group by
Art.Cod_Articulo_Aux,
teal.fec_vencimiento
-- -*-*-*-*-*-*-*-*-*-*-*
-- Show results
-- -*-*-*-*-*-*-*-*-*-*-*
Execute ('Select cod_Articulo as [Código], ' +
' Saldo_lote as [Stock] ' +
'From #tmp_Articulos_Vencidos ' +
'Where (1=1) ' +
'Order by 2 ' )
drop table #tmp_Articulos_Vencidos
--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
After :
Select Art.Cod_Articulo_Aux as cod_Articulo,
cast(sum(isnull(TEAL.num_stock_saldo_lote,0)) as decimal(15,5)) as Saldo_Lote
INTO #tmp_Articulos_Vencidos
From tab_existencias_almacen as tea with (nolock)
Join tab_Articulo as Art with (nolock)
On Art.Cod_Catalogo = Tea.Cod_Catalogo
And Art.Cod_Articulo = Tea.Cod_Articulo
And Art.fla_reg_lote = 'S'
Left
join tab_existencias_almacen_lote as TEAL with (nolock)
On TEAL.Cod_Pais = Tea.Cod_Pais
And TEAL.Cod_Almacen = Tea.Cod_Almacen
And TEAL.Cod_Articulo = Tea.Cod_Articulo
And TEAL.Cod_Catalogo = Tea.Cod_Catalogo
Where
Tea.Cod_pais = @.Cod_pais
and Alm.Cod_Terra = @.Cod_Terra
Group by
Art.Cod_Articulo_Aux,
teal.fec_vencimiento
-- -*-*-*-*-*-*-*-*-*-*-*
-- Show results
-- -*-*-*-*-*-*-*-*-*-*-*
Execute ('Select cod_Articulo as [Código], ' +
' Saldo_lote as [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...
> > 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?
>
>|||> 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?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment