Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2012-04-12 : 10:58:26
|
| These are strings in the table under column xmlTransaction and they can be in any order:<Person update ><Person insert ><CPAdress update ><CPAdress insert ><Person update ><Person insert ><CPAdress update ><CPAdress insert >I always need all the <Person insert > to be at the top andIt doesn't matter about the others.If I order by xmlTransaction I get CPAdress before PersonIf I order by xmlTransaction desc I get Person updateI could just get the Person Inserts then the person updates then CPAaddress but thats a bit of an effort and I don't know how to escape the = and quote marks as the full string is:<Person ActionType="Insert" |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2012-04-12 : 11:26:29
|
quote: Originally posted by insanepaul I always need all the <Person insert > to be at the top andIt doesn't matter about the others.
ORDER BY CASE WHEN xmlTransaction like '<Person Insert%' THEN 0 ELSE 1 END |
 |
|
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2012-04-12 : 11:32:22
|
| Thanks for the help |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2012-04-12 : 12:26:57
|
| You're welcome. :) |
 |
|
|
|
|
|