Extended Events shows each SQL command in one long line

  • Hi all,

    I created Extended Events session to capture sql_batch_completed for duration>5 sec sending to a target  as OS file. Then, I load them periodically into a table using function fn_xe_file_target_read_file.

    But the problem is that instead of showing SQL command with original proper formatting, it flatten it out in one long string. Especially when it has (--) comment inside, it looks like the most of the SQL string  is commented.

    Is there a way to fix it?

    Thanks

     

     

  • How are you getting this query out from the database? Are you, by any chance, copying out of a grid view in SSMS? Is so, do you have Retain CR/LF enabled?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Yes Thom, I am doing exactly that. Now I tried results to TEXT and it works fine. But the TEXT results when I execute the query, is running very slowly. How can I retain CR/LF from Grid results?

    Thanks

     

  • Thanks you Thom, I found it in Tools/Options. It works great now!

    Thanks again!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply