title: pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near
body: <p>I'm using python 3.9 to insert a list of multiple news from google rss news to SQL table with parameter using pyobc but always getting programming error below:</p>
  <blockquote>
  <p>cursor.execute(query) pyodbc.ProgrammingError: ('42000', &quot;[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'cò'
  . (102) (SQLExecDirectW)&quot;)</p>
  </blockquote>
  <p>I checked the sql table and found out actually some of records had been imported to SQL successfully (15 records ) but not all of its (30 records)</p>
  <p>Below its all of my codes pls help !</p>
  <pre><code>import bs4
  from bs4 import BeautifulSoup as soup
  from urllib.request import urlopen
  import pyodbc
  
  news_url=&quot;https://news.google.com/rss?hl=vi&amp;gl=VN&amp;ceid=VN:vi&quot;
  Client=urlopen(news_url)
  xml_page=Client.read()
  Client.close()
  soup_page=soup(xml_page,&quot;xml&quot;)
  news_list=soup_page.findAll(&quot;item&quot;)
  
  cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=ADMIN;DATABASE=NewsCollect2')
  cursor = cnxn.cursor()
  
  for news in news_list:
      query = f&quot;insert into news2(Title,Source1,Time1) values (N'&quot;+news.title.text+&quot;',N'&quot;+news.source.text+&quot;',N'&quot;+news.pubDate.text+&quot;')&quot;
      cursor.execute(query)
      cursor.commit()
  cursor.close()
  cnxn.close()
  </code></pre>
  <p>p/s I tried to extract to txt file and it worked totally fine</p>