On Sun, May 15, 2011 at 5:10 PM, Mr. Puneet Kishor <punk.k...@gmail.com>wrote:

>
> > A table:
> >
> > id, eventName, date
> >
> > I want to rename date to dateAdded.
> >
>
>
> sqlite doesn't support changing the name of a table column (and, neither
> you nor your user should be doing this -- there is something strange with
> your app requirements).


I was describing what I have to do when I need to change a DB's schema.
Software isn't always perfect and sometimes needs to be changed.




> That said, you can "rename" a column by creating a new table with the new
> column definitions and copy data from the old table to the new table.
>
> CREATE TABLE new_table (id, eventName, dateAdded);
> INSERT INTO new_table (id, eventName, dateAdded) SELECT id, eventName, date
> FROM old_table;
>


Thanks to you and everybody else who's provided a sample of code to do this,
but I want to be more productive in my software development. An analogy: if
I want to create a letter with pretty styles and maybe images, I will use MS
Word or, at least, Open Office. I will not write a program to do that :)
So, I want a web based tool I use to allow me to quickly and easily rename a
column.

Secondly, if I executed the above SQL code, what would happen to triggers,
etc. that are associated with the original table?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to