none
Check datatype of Column in Sqlite database RRS feed

  • Question

  • Hello,

    I changed the datatype of a Column with some help and saved the data that was in there.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/c8a1c5da-de99-4272-90a6-0cbb8cc315e2/alter-column-type-in-sqlce-database?forum=vbgeneral

    But now i have to figure out the data type of the Column Startdate , when it is nvarchar i have to change it.

    When Column Startdate is datetime do nothing

    Normaly i use SDF viewer to change it but it is a database that is in use on several computers , so i have to check it with code.

    The database is SQLite 3.5.

    Using the 2017 version of visual studio and framework 3.5

    Saturday, February 9, 2019 7:40 PM

Answers

  • Hello,

    It appears that this is not possible, see the following thread

    https://www.techonthenet.com/sqlite/tables/alter_table.php

    You can not use the ALTER TABLE statement to modify a column in SQLite. Instead you will need to rename the table, create a new table, and copy the data into the new table.



    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by KeesBlunder Monday, February 11, 2019 6:55 AM
    Sunday, February 10, 2019 2:47 AM
    Moderator

All replies

  • Hello,

    It appears that this is not possible, see the following thread

    https://www.techonthenet.com/sqlite/tables/alter_table.php

    You can not use the ALTER TABLE statement to modify a column in SQLite. Instead you will need to rename the table, create a new table, and copy the data into the new table.



    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by KeesBlunder Monday, February 11, 2019 6:55 AM
    Sunday, February 10, 2019 2:47 AM
    Moderator
  • I see 

    Thanks for the link Karen

    Sunday, February 10, 2019 7:59 AM
  • Hi,

    Do you resolve the issue? If you resolve the issue,please mark the helpful as answer.

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 11, 2019 1:29 AM