title: Trying to update all string values of 'NULL' to NULL in sql server
body: <p>I have a database table that was imported from a csv file which had <code>NULL</code> in it, so that when it was imported instead of fields being NULL they contain the string value <code>'NULL'</code>.</p>
  
  <p>The CSV file is to big to open in a text editor to edit out all of the <code>NULL</code> so I am trying to create a SQL query to update each column of the table.</p>
  
  <p>So far I have this</p>
  
  <pre><code>Alter PROCEDURE [dbo].[sp_fixnulls]
       @column nvarchar(100) 
  AS
  BEGIN
       SET NOCOUNT ON;
       UPDATE my_table
       SET @column=''
       WHERE @column = 'NULL'
  END 
  
  ---------------
  
  sp_fixnulls (SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME  ='my_table')
  </code></pre>
  
  <p>but this is not working. I get the error message</p>
  
  <blockquote>
    <p><em>Msg 201, Level 16, State 4, Procedure sp_fixnulls, Line 0<br>
    Procedure or function 'sp_fixnulls' expects parameter '@column', which was not supplied.</em></p>
  </blockquote>