A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Adding columns for all the tables in DB
Joined: Mar 24, 2008
Nov 25, 2008 03:11:00
I want to add a new column named version with initial value 0 for all the tables present in a database. What can be done to do this?
Any help is appreciated.
Joined: Sep 11, 2006
Nov 25, 2008 03:15:00
You can write the sql code :
alter table tablename add version integer default 0;
Hope this helps ..
Joined: Apr 14, 2004
Nov 25, 2008 03:29:00
... and you can generate this script based on the database catalog. What database are you using?
subject: Adding columns for all the tables in DB
Row level lock in Hibernate
SQL command to show tables
I have fresh new 80 tables in DB, but with no data. Any utility to populate dummy data in all table
getPrimaryKeys() method of DatabaseMetaData
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014