title: SQL Server- Bulk Export Data without html formatting and line spaces
body: <p>I need to export some Database data into a text file. My Query looks like this:</p>
  
  <pre><code>SELECT Category1, Category2, Category3 
  FROM dbo.tbl1
  WHERE Category1 = 'JP-4'
  AND Category2&gt; 4;
  </code></pre>
  
  <p>This works fine to get the data, however there is some html formatting in the table entries such as
  <code>&lt;p&gt;,&lt;/p&gt;,&lt;br&gt;,&lt;/br&gt;</code> etc. So ideally I need to remove those when exporting the data to the text file. I've tried to do it with a simple replace query but that didn't work.
  I've also got an issue with line splits and would need to remove the (\n\r).
  Any suggestions on how to do this would be really appreciated!</p>
  
  <p>The Data format is something like this:</p>
  
  <pre><code>Category1: JP-4
  Category2: 4
  Category3:&lt;p&gt;Neque porro quisquam est qui dolorem ipsum quia dolor&lt;/p&gt;  &lt;p&gt;amet, consectetur, adipisci velit&lt;/p&gt;
  Category4:&lt;p&gt;Neque porro quisquam est qui dolorem ipsum quia dolor&lt;/p&gt;  
  </code></pre>
  
  <p>I got it to work with: </p>
  
  <pre><code>SELECT REPLACE(REPLACE("Category3",'&lt;p&gt;',''),'&lt;/p&gt;','') 
  FROM dbo.tbl1
  WHERE Category1= 'JP-4'
  AND Category2&gt; 4;
  </code></pre>
  
  <p>But the issue is that I've got 15 columns in total and that I need to do it for several different tags for each column and I thought there must be a better/more efficient way of doing it.
  I've looked all over the internet but couldn't really find a solution. </p>