sql and xml syntax issue

In Query Analyzer (MSsql) one enters "<" for less than, however, pasting the query into an xml file for another routine to read is syntactically incorrect. That is, "<" signals a tag to follow and the query bombs. I'm unsure if changing "<" in an xml file to "&lt;" is the workaround. Any suggestions? Thanks.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

this sounds strange, but can you maybe write "LESS THAN" directly?
For xml < means starting a Tag. Just replace them with  "&lt;". It will fix the things. And when reading at the other side be sure this changed is handled also

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cwest1Author Commented:
Just wait till we're writing and mixing C# and sql procs in SQL Server! That ought casue some problems :)
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.


Glad I helped.

Can you please explain why B grade? I think I answered you completely... if not - you can ask for clarifications.

See the grading policy here:

It's not for the points but for the PAQ value - if it is be then whoever sees the question will think it is not complete answer. But if you have your reasons, I'll be happy to hear them

cwest1Author Commented:
I'm sorry, I wasn't fully aware of the grading paradigm. An "A" is fine.
Done, thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.