title: Run SQL Server Update Statement With Powershell
body: <p>Should be straight forward, but I keep getting this error</p>
  
  <blockquote>
    <p>shipping_status is not a recognized function name</p>
  </blockquote>
  
  <p>And this is my syntax - what is causing this, as my statement will run issue free in SSMS</p>
  
  <pre><code>$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
  $SqlCmd.Connection=New-Object System.Data.SqlClient.SqlConnection
  $SqlCmd.Connection.ConnectionString='Server=Server1;Database=DB1;Integrated Security=True'
  $SqlCmd.Connection.Open()
  $SqlCmd.CommandText="UPDATE firefly.light.dbo.shipped SET shipped = 'Yes' WHERE shipping_status IN ('Loading', 'Shipped') "
  $SqlCmd.ExecuteNonQuery()
  </code></pre>