• Post Reply Bookmark Topic Watch Topic
  • New Topic

most efficient way to insert records in a DB  RSS feed

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

I'm using the PreparedStatements's executeUpdate method. But sometimes there are blockings that occur in SQLServer that prevent the record from being inserted...

What is the most efficient way of inserting records in MS SQL 2000?
 
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you updating records or inserting?
 
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Order your all of you inserts/updates in a single transaction to always update all tables in a specific order (for example, always update table A before table B, table B before table c, etc for all transactions). This prevents locking due to cycles.

Many times though, such ordering is difficult to implement.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!