Search code examples
sql-server-2008t-sqlssms

MS SQL Server - Export Results To File without "NULL"


I am using SQL Server Management Studio to export the results of my query to text. I would like to export the results without the character NULL being printed between delimiters.

For example, instead of:

,NULL, 

I would like to export:

,,

Thanks for your help


Solution

  • Just simply use

    ISNULL(someColumn, '')
    

    in our query. This will replace all NULL values with an empty string