1. Create a functional query in SMS MMC to return desired data.
2. Start SQL profiler & create a new trace... add the SMS_Provider component.
3. Run the SMS query in MMC - Profiler captures actual SQL code issued via SMS_PROVIDER.
4. Copy SELECT statement from Profiler's Trace tool.
5. Paste SQL statement into SQL Query Analyzer as a new query
6. Do a little SQL syntax cleanup in Analyzer... SMS Profiler captures SQL statement's values using double-quotes; Query Analyzer requires single-quotes... edit where necessary (tip: When you parse the query in Analyzer, it'll return a syntax error referencing the first occurrence of the offending text - look for that text in the statement & you'll find the double-quotes, displayed in gray. Replace the double quotes with single, and the value will change to red text, indicating correct syntax).
from http://www.myitforum.com/articles/5/view.asp?id=190
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment