title: How to change the data type of a CSV when INSERTING the data into SQL server via Python?
body: <p>I'm pulling data from a feed and saving it as a .csv file, which is then being inserted into SQL server.</p>
  <p>However, the column &quot;datetime&quot; is by default, set as nvarchar(50).</p>
  <p>How can I make it so that this datetime column converts to the datatype datetime BEFORE inserting it into the SQL table?</p>
  <p>Also, how can I substring the datetime column into 2 separate columns such as column: date and column: time before inserting into the table?</p>
  <p>The substring and left functions that I want to use are:
  SUBSTRING(datetime,12,5) as 'time'
  LEFT(datetime,10) as 'date'</p>
  <pre><code>columns = ['Datetime', 'Open', 'High', 'Low', 
          'Close', 'Adj Close', 'Volume']
  
  
  df_data = df[columns]
  records = df_data.values.tolist()
  
  
  
      
  sql_insert = '''
      INSERT INTO Live_Ticker
      VALUES (?, ?, ?, ?, ?, ?, ?)
  '''
  </code></pre>