Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding columns for all the tables in DB

 
Thyagarajan Ramanujam
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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.
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write the sql code :

alter table tablename add version integer default 0;


Hope this helps ..
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... and you can generate this script based on the database catalog. What database are you using?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic