Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running in Query Analyser not through ADO

Status
Not open for further replies.

Rajeswari

Technical User
Oct 6, 2001
17
IN
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top