Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
User Journal

Journal Bill Dog's Journal: would've never guessed that 2

Ran into something today. Found the answer:

4. INSERT queries that use SELECT with ORDER BY to populate rows guarantees how identity values are computed but not the order in which the rows are inserted

Mentally masticate on that one for a minute. You carefully craft an ordered query for output to a web page view. But you need to return other resultsets based on it, so you INSERT that SELECT into a table variable, use it to produce your other resultsets, and then finally SELECT from the table var as the last resultset to return.

But then you find your ordered query is ordered, just not your order! Would've never seen that even coming. So I slapped an IDENTITY column on the table var and sorted on it for the final resultset. Whatevs.

This discussion has been archived. No new comments can be posted.

would've never guessed that

Comments Filter:

An authority is a person who can tell you more about something than you really care to know.

Working...