ORDER BY SYSCOLUMNS.COLID should be ORDER BY sysindexkeys.keyno
Ordering by COlID causes wrong columns order in the key.
What exactly is your question?
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)