in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Change type of field

Last post 03-03-2008 1:08 PM by cfdelaune. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-31-2008 2:30 AM

    Change type of field

    In mysql i used

     

    ALTER TABLE `te` CHANGE `4` `ga` VARCHAR( 2 ) NOT NULL
     
    what the sql lite equaliant 

     

    Filed under: ,
  • 01-31-2008 9:14 AM In reply to

    • Nate
    • Top 10 Contributor
    • Joined on 08-28-2005
    • Fort Collins, CO
    • Posts 68

    Re: Change type of field

    Hi Thomaxz

    Just use standard SQL. 

    http://www.w3schools.com/sql/sql_alter.asp

    http://www.sqlite.org/lang_altertable.html 

  • 01-31-2008 11:47 AM In reply to

    • Sam_
    • Top 10 Contributor
    • Joined on 02-14-2007
    • Washington DC
    • Posts 86

    Re: Change type of field

    SQLite has very limited alter table support.  The link Nate points to shows the syntax.

    For renaming a column, you really need to rename the original table, create a new table with the new column name, and then copy the data over.

    HTH,

    Sam 

    We're hiring! B-Line Medical is seeking .NET Developers for exciting positions in medical product development in MD/DC. Work with a variety of technologies in a relaxed team environment. See ads on http://careerbuilder.com.
  • 03-03-2008 1:08 PM In reply to

    Re: Change type of field

    Hello,

    All I need to do is change the datatype of a column from INT to BIGINT.  Is there a way to do this in SQLite?

    I use this tool (http://sqliteadmin.orbmu2k.de/) as a visualizer for SQLite and it is amazingly easy to do here, so I am assuming that there is some simple call that I can make in my code to change the column's datatype.

    Thanks in advance!

    Christian 

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems