I read this article https://www.c-sharpcorner.com/blogs/how-to-make-faster-sql-server-search-part-three
they said if i use dbo schema name before table name in select statement then sql server return result faster.....is it true? if yes then why result would return faster?
see this code sample
public static async Task<DataTable> GetDataTableAsync(string cSql, SqlConnection oCnn)
{
using (var command = new SqlCommand(cSql, oCnn, null))
{
var source = new TaskCompletionSource<DataTable>();
var resultTable = new DataTable(command.CommandText);
try
{
// CommandBehavior.SingleRow - This is the secret to execute the datareader to return only one row
using (var dataReader = await command.ExecuteReaderAsync(CommandBehavior.SingleRow))
{
resultTable.Load(dataReader);
source.SetResult(resultTable);
}
}
catch (Exception ex)
{
source.SetException(ex);
}
finally
{
}
return resultTable;
}
}
please tell me what CommandBehavior.SingleRow does in above code ? does it return only single row if even select return multiple data ? please tell me when to use CommandBehavior.SingleRow ?
Thanks