I am receiving the following error when trying to import a .csv file that was exported from the same module on a different site. This is a Drupal 7 installation using Windows 7 and MS SQL 2008r2. I have also attempted to use a .txt file with the same information and by populating the textarea directly.

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /subsite/batch?render=overlay&id=7&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'LIMIT'.: SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE :name LIKE LOWER(t.name) AND {t.vid} = :vid ORDER BY {t.tid} ASC LIMIT 1; Array ( [:name] => 3d animation schools [:vid] => 4 ) in taxonomy_csv_term_find() (line 92 of \wwwroot\sites\all\modules\taxonomy_csv\taxonomy_csv.term.api.inc).

CommentFileSizeAuthor
#5 1178366.taxonomy_csv.patch2.05 KBdagmar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rickmanelius’s picture

Same, but with the dev branch.

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?render=overlay&id=3&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'drupal_t.vid' in 'where clause': SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE :name LIKE LOWER(t.name) AND {t.vid} = :vid ORDER BY {t.tid} ASC LIMIT 1; Array ( [:name] => test term [:vid] => 4 ) in taxonomy_csv_term_find() (line 91 of /website/trunk/public_html/sites/all/modules/taxonomy_csv/taxonomy_csv.term.api.inc).
rickmanelius’s picture

It seems in the above that there is an inconsistent usage of whether the drupal database tables use a prefix (such as drupal_).

Daniel_KM’s picture

Hi,

I don't have any expensive Microsoft product, so I can't check your issue.

It looks like this error is similar of this one (double prefix). I've just committed the patch on 7.x-5.x branch. Could you check if it fixes your problem? Thanks,

Daniel Berthereau
Infodoc & knowledge manager

Daniel_KM’s picture

Version: 7.x-5.6 » 7.x-5.x-dev
Status: Active » Needs review
dagmar’s picture

FileSize
2.05 KB

I think the problem is related to the LIMIT added after the ORDER BY.

Sql Server uses TOP(1) instead of LIMIT 1.

The attached patch replaces the query by a similar one using the dbtng api, that handles the limit properly.

Daniel_KM’s picture

Status: Needs review » Fixed

Thanks,

Your patch has been committed.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bob.foks’s picture

It must be connected with sql database file corruption.
For realizing successful imporing MS SQL database make use next software http://www.recoverytoolbox.com/sql.html