By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

Update rows in

P: 77
I have two tables, Update1 and Master1. Master1 is thousands of records and is recreated twice a day. The Update1 rows are created when someone reads and updates a Master1 row (since Master1 gets dropped and recreated twice a day).

I am writing a stored proc to re-connect the two tables. My question is: what is the most performant way when I drop and repopulate Master1, to iterate through Update1 and to set a bit column to true in Master1 (if a record exists in Update1)?

Any help would be appreciated.
Feb 18 '09 #1
Share this Question
Share on Google+
2 Replies


100+
P: 152
gpl
Try something like this

Expand|Select|Wrap|Line Numbers
  1. UPDATE Master1
  2. SET bitfield=1
  3. FROM Master1 m1
  4. INNER JOIN Update1 u1 ON m1.keyvalue=u1.keyvalue
Feb 19 '09 #2

P: 77
gpl,

Thanks for the pointer. I was trying to avoid a join, but if that will likely be faster than using a cursor (I would think).
Feb 19 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.