Quimbly
3/29/2007 10:58:00 PM
> Can you be a bit more specific about what you're doing?
The top-level CLR proc calls a regular static method in the SQL CLR project.
This static method makes a call to another SqlProcedure (static method
tagged with [Microsoft.SqlServer.Server.SqlProcedure] attribute).
The static method is calling the lower-level CLR proc as follows:
string sqlString = "LC_SP_ScheduleEvents_SelectForDate";
SqlCommand command = new SqlCommand(sqlString, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@P_LuminaireID", luminaireID);
command.Parameters.AddWithValue("@P_TargetDate", usageDate);
command.Parameters.AddWithValue("@P_TargetDateStartInUTC", startTimeUTC);
command.Parameters.AddWithValue("@P_TargetDateEndInUTC", endTimeUTC);
SqlDataReader reader = command.ExecuteReader();
//...
Inside the LC_SP_ScheduleEvents_SelectForDate proc, it times out when it's
piping it's results back:
I.e.:
....
for (int i = 0; i < dr.Length; i++)
{
// send one event
eventRow = new SqlDataRecord(eventRowMetaData);
eventRow.SetSqlBoolean(0, bool.Parse(dr[i]["IsLampOn"].ToString()));
eventRow.SetSqlDateTime(1,
DateTime.Parse(dr[i]["ActualEventTime"].ToString()));
eventRow.SetInt32(2, int.Parse(dr[i]["DimmingLevel"].ToString()));
SqlContext.Pipe.SendResultsRow(eventRow);
}
}
SqlContext.Pipe.SendResultsEnd();