Instead of using SELECT just before the INSERT try using SET
--------------------------
Sent from my BlackBerry Wireless Handheld
-----Original Message-----
From: Heraclio Cejas Corrales <mssqldba-ezmlmshield-x77951495.[Email address protected]
To: LazyDBA Discussion <[Email address protected]
Sent: Tue Dec 26 07:51:10 2006
Subject: Urgent Help
Hi All:
When I execute under Sql Server 2000 the following:
create table #saldo_alimento (
OperationUnitdID int ,
InternalCode varchar(20),
OperationUnitTypeID int,
OperationUnitTypeName varchar (30),
BirdType varchar(50),
Lotcode varchar(30),
FeedStorageID int,
Description varchar (50),
HourFeedDelivery int,
Active bit,
BalanceDate datetime,
FeedtypeID int,
FeedType varchar(50),
CloseBalance float,
TransportSheet int
)
declare @inicio varchar(8)
declare @termino varchar(8)
SELECT @inicio = CONVERT(char(8), Current_Timestamp, 112) +
Replace(Convert(char(5), Current_Timestamp, 114), ':','')
SELECT @termino = CONVERT( char(8), Current_Timestamp, 112) +
Replace(Convert(char(5), Current_Timestamp, 114),':','')
insert into #saldo_alimento
exec IFMX_FeedInventory @inicio, @termino
I receive the message:
Server: Msg 8164, Level 16, State 1, Procedure IFMX_FeedInventory, Line 35
An INSERT EXEC statement cannot be nested.
Server: Msg 8164, Level 16, State 1, Procedure IFMX_FeedInventory, Line 35
An INSERT EXEC statement cannot be nested.
Server: Msg 8164, Level 16, State 1, Procedure IFMX_FeedInventory, Line 35
An INSERT EXEC statement cannot be nested.
Server: Msg 8164, Level 16, State 1, Procedure IFMX_FeedInventory, Line 35
An INSERT EXEC statement cannot be nested.
Server: Msg 8164, Level 16, State 1, Procedure IFMX_FeedInventory, Line 35
An INSERT EXEC statement cannot be nested.
(0 row(s) affected)
Thanks in advance.
Heraclio Cejas Corrales.
DBA Chile
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
The information contained in this electronic message is for the exclusive and confidential use of the addressee. Any other distribution, use, reproduction or alteration of the information contained in this electronic message, by the addressee or by any other recipient, without the prior written consent of the sender is strictly prohibited. If you have received this electronic message in error, please notify the sender.
MS Sql Server LazyDBA home page