G
Guest
Folks, I'm at the point where my cube has a dent on the side of it that is
shaped like my head........can't figure this one out.
I have a procedure that has ro be run for every month from 1/1/2001 to the
current month. It takes a @StartDate and @EndDate parameter.
I can't change the procedure to just execute from '1/1/2001' to GETDATE()
because it would take way too long to execute.
The proc is effectively just a complex select statement.
If I go into SQL Query Analyzer and say:
exec procname '1/1/2001','1/31/2001';
exec procname '2/1/2001','2/31/2001';
.....etc....etc....
exec procname '3/1/2006','3/31/2006';
Everything is fine...life is good
However if, from ADO.NET (SqlClient native provider), and I Execute this
command for each date range, it freezes up.
I've tried:
Preparing the command.....no change
Opening and closing/Disposing the connection for every command....no change
Having multiple threads execute the command for different months
simultaneously .... no change
Having the command execute a SQL statement where sql="exec procname
'1/1/2001','1/31/2001';exec procname '2/1/2001','2/31/2001' (etc etc) "....no
change
Creating a transaction (read uncomitted) ... no change
Any idea what could be causing the behavior? Everything works fine in Query
Analyzer, but it just freezed when I try to go through ADO.NET
shaped like my head........can't figure this one out.
I have a procedure that has ro be run for every month from 1/1/2001 to the
current month. It takes a @StartDate and @EndDate parameter.
I can't change the procedure to just execute from '1/1/2001' to GETDATE()
because it would take way too long to execute.
The proc is effectively just a complex select statement.
If I go into SQL Query Analyzer and say:
exec procname '1/1/2001','1/31/2001';
exec procname '2/1/2001','2/31/2001';
.....etc....etc....
exec procname '3/1/2006','3/31/2006';
Everything is fine...life is good
However if, from ADO.NET (SqlClient native provider), and I Execute this
command for each date range, it freezes up.
I've tried:
Preparing the command.....no change
Opening and closing/Disposing the connection for every command....no change
Having multiple threads execute the command for different months
simultaneously .... no change
Having the command execute a SQL statement where sql="exec procname
'1/1/2001','1/31/2001';exec procname '2/1/2001','2/31/2001' (etc etc) "....no
change
Creating a transaction (read uncomitted) ... no change
Any idea what could be causing the behavior? Everything works fine in Query
Analyzer, but it just freezed when I try to go through ADO.NET