Hi,
I came across a very weird problem. I get a statement from a file, dump
the text into a sql command, add a sql parameter and run the query.
This lasts about 1 1/2 hours, compared to 2-3 minutes running the same
statement from within the sql query analyzer.
To get around this problem I added the following lines INTO the
statement file:
declare @param int
set @param = 20060411
using this, the statement lasts 2-3 minutes.
When using s sql parameter with the sql command the same statement
needs 1 1/2 hours. I added the parameter as follows:
cmd.Parameters.Add("@FromDate_SID", date.ToString(("yyyyMMdd")));
or
cmd.Parameters.Add("@FromDate_SID",
Convert.ToInt(date.ToString(("yyyyMMdd"))));
Both result in a duration of 1 1/2 hours.
Does anyone can give me a clue on this? I'm lost, and I am running out
of ideas.
Thanks in advance
Michael