I am Using 2 Stored procedures A and B and about 8 tables.
In Stored Procedure A, i am calling Stored procedure B. Stored Procedure B returns about 300000 records to stored procedure where i copy to flat file. I set query time out, connection time out to zero, still successive statements after the call to stored procedure B is not executing.
If i run it from query analyser, it's working properly, but not through ADO(Visual Basic).
Stored Procedure A:
Create Procedure A
As
declare @command varchar(1000)
begin
set @command = 'bcp "EXEC B" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
set @command = 'bcp "Select * from Table1" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
set @command = 'bcp "Select * from Table2" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
end
Stored Procedure B:
Create Procedure B
As
--This table contain about 300000 records
select * from table4
go
From Visual Basic I set command timeout and Connection time out to zero.
In Stored Procedure A, i am calling Stored procedure B. Stored Procedure B returns about 300000 records to stored procedure where i copy to flat file. I set query time out, connection time out to zero, still successive statements after the call to stored procedure B is not executing.
If i run it from query analyser, it's working properly, but not through ADO(Visual Basic).
Stored Procedure A:
Create Procedure A
As
declare @command varchar(1000)
begin
set @command = 'bcp "EXEC B" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
set @command = 'bcp "Select * from Table1" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
set @command = 'bcp "Select * from Table2" queryout \\path -c -u test -p test'
exec xp_cmdshell @command
end
Stored Procedure B:
Create Procedure B
As
--This table contain about 300000 records
select * from table4
go
From Visual Basic I set command timeout and Connection time out to zero.