title: SQL Server: Bulk Insert into table with computed column
body: <p>I try to insert data from a textfile into a SQL Server 2016 table with a computed column with bcp.</p>
  
  <p>My bcp command:</p>
  
  <pre><code>bcp Test.dbo.myFirstImport IN D:\myFirstImport.txt -f D:\myFirstImport.xml –T
  </code></pre>
  
  <p>My table:</p>
  
  <pre><code>CREATE TABLE [dbo].[MyFirstImport](
         [PersonID] [smallint] NULL,
         [FirstName] [varchar](25) NULL,
         [LastName] [varchar](30) NULL,
         [BirthDate] [date] NOT NULL,
         [YearMonthCom]  AS (datepart(year,[BirthDate])*(100)+datepart(month,[BirthDate])) PERSISTED
  ) ON [PRIMARY]
  </code></pre>
  
  <p>My Data (tab separated):</p>
  
  <pre><code>1   Anthony   Grosse      1980-02-23
  2   Alica     Fatnowna    1963-11-14
  3   Stella    Rosenhain   1992-03-02
  </code></pre>
  
  <p>My format file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
   &lt;RECORD&gt;
    &lt;FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="7"/&gt;
    &lt;FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="25" COLLATION="SQL_Latin1_General_CP1_CI_AS"/&gt;
    &lt;FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="30" COLLATION="SQL_Latin1_General_CP1_CI_AS"/&gt;
    &lt;FIELD ID="4" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="11"/&gt;
    &lt;!--
    &lt;FIELD ID="4" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="11"/&gt;
    &lt;FIELD ID="5" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="12"/&gt;
    --&gt;
   &lt;/RECORD&gt;
   &lt;ROW&gt;
    &lt;COLUMN SOURCE="1" NAME="PersonID" xsi:type="SQLSMALLINT"/&gt;
    &lt;COLUMN SOURCE="2" NAME="FirstName" xsi:type="SQLVARYCHAR"/&gt;
    &lt;COLUMN SOURCE="3" NAME="LastName" xsi:type="SQLVARYCHAR"/&gt;
    &lt;COLUMN SOURCE="4" NAME="BirthDate" xsi:type="SQLDATE"/&gt;
    &lt;!--
    &lt;COLUMN SOURCE="5" NAME="YearMonthCom" xsi:type="SQLINT"/&gt;
    --&gt;
   &lt;/ROW&gt;
  &lt;/BCPFORMAT&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My error</p>
  
  <blockquote>
    <p>SQLState = 37000, NativeError = 1934
    Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Fehler bei INSERT,
    da die folgenden SET-Optionen falsche Einstellungen aufweisen: "QUOTED_IDENTIFIER". Überprüfen Sie, ob die SET-Optionen für die Verwendung mit indizierte Sicht
    en und/oder Indizes für berechnete Spalten und/oder gefilterte Indizes und/oder
    Abfragebenachrichtigungen und/oder XML-Datentypmethoden und/oder Vorgänge für rä
    umliche Indizes richtig sind.
    BCP copy in failed</p>
  </blockquote>
  
  <p>And in English</p>
  
  <blockquote>
    <p>INSERT failed because the following SET options have incorrect settings: "QUOTED_IDENTIFIER". Verify that the SET options are correct for use with indexed views and / or indexes on computed columns and / or filtered indexes and / or query notifications and / or XML data type methods and / or spatial indices operations</p>
  </blockquote>