0

I am using "System.Data.SQLite;". The Dll version is 1.0.103.0.

My sql statement is ALTER TABLE main.[Resistors] RENAME [Manufacturer Part Number] to [Manufacturer Part Number 1]; The error message I get is "Message=SQL logic error or missing database"

I have also tried ALTER TABLE [Resistors] RENAME COLUMN [Manufacturer Part Number] to [Manufacturer Part Number 1]; Which returned "SQL logic error or missing database near "COLUMN": syntax error"

and tried ALTER TABLE main.[Resistors] RENAME COLUMN [Manufacturer Part Number] to [Manufacturer Part Number 1]; Which returned "SQL logic error or missing database near "COLUMN": syntax error

I'm assuming I need to change "main." to something else but I don't know what it should be. Or I need to update my SQLite. I'm working on that.

  • 1
    Does this answer your question? [How do I rename a column in a SQLite database table?](https://stackoverflow.com/questions/805363/how-do-i-rename-a-column-in-a-sqlite-database-table) – Alejandro Mar 03 '22 at 19:28
  • I tried to add the word "Column" but it didn't seem to help. I'm not sure what I'm missing. – Eric Minnaert Mar 03 '22 at 21:32
  • It looks like my SQLite dll is a bit older. Looks like I can download the setup from this site. Can anyone confirm that this the proper way to set it up or update the dll? https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki – Eric Minnaert Mar 03 '22 at 22:00
  • I found out that the SQL commands were correct. The issue was the reference used in visual studio was not supporting the rename command. I don't know why why but using this nuget package solved the issue. System.Data.SQLite.1.0.116.0.nupkg – Eric Minnaert Sep 29 '22 at 20:36

1 Answers1

0

Some of the versions of SQLite do not support renaming columns. Try updating the references available in your project. See this NuGet Filename. This version supports renaming columns.

System.Data.SQLite.1.0.116.0.nupkg