Strange behaviour in record ordering -
07-19-2007
, 10:49 AM
Hi,
Can anyone suggest what is going wrong here? I have created a stored
procedure in SQL2005 Express, which builds a temp table, messes with data a
bit, and returns this data. The order of the returned records is important.
This is the last line of the SP.
SELECT * FROM #TempTable WHERE [Priority]=@TopPriority order by Priority
asc, [triggerlevel] desc, [Discount] desc
This works fine when using Server Management Studio - returning the records
in the correct order.
However, when I try call this Stored procedure from within VB.NET using
executereader to fill a dataset, the records come through in a different
order. (i.e. Trigger level is sorted ASCENDING).
Any suggestions - even if it is another newsgroup to send this problem to?
This is really beginning to frustrate me?
Thanks,
Jason |