Strange behaviour in record ordering



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


.



Relevant Pages

  • Re: Why is MSFax creating temp files - Visible in Windows API, but not in MFT or directory index
    ... Empty out ALL your PC and Browser Temp files and Cache etc. ... .Scan you system with Anti Virus software which has the latest ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: Recordset problem
    ... Parse and loop through passed parameters and create a SQL query ... Run that string using sp_executesql and store results in a temp ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Re: importing and updating data
    ... tina wrote: ... > matching records in the temp table. ... Since the data is not necessarily unique, ie, some of the ... If another newsgroup is more appropriate for this ...
    (microsoft.public.access.formscoding)
  • Re: importing and updating data
    ... I still have some tweaking to do, ... tina wrote: ... > matching records in the temp table. ... If another newsgroup is more appropriate for this ...
    (microsoft.public.access.formscoding)
  • Re: importing and updating data
    ... tina wrote: ... > matching records in the temp table. ... Since the data is not necessarily unique, ie, some of the ... If another newsgroup is more appropriate for this ...
    (microsoft.public.access.externaldata)

Loading