| Author |
Topic |
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2010-12-23 : 09:33:33
|
| Need some direction to update rows in our tablesAre there any tools to generate queries to update rows in bulk.In the below Example script Iam trying to update our contact table with workid and employeeid of employees based on their contact_id and emailI am not sure how do i generate queries to update 1000 records at a time.Doing it manually is eating up my timeUPDATE contact SET workid='xyxxx',empid='12345678' WHERE contactid=8976 AND email='xyz1234@yahoo.com; |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-23 : 09:40:56
|
| Do you want to update the same for all rows?MadhivananFailing to plan is Planning to fail |
 |
|
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2010-12-23 : 09:42:19
|
| Nope.It is differant workid,empid for differant contactid'sThanks |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-12-23 : 09:54:11
|
| Are you fetching data from other table ?I mean forUPDATE contact SET workid='xyxxx',empid='12345678' WHERE contactid=8976 AND email='xyz1234@yahoo.com;Where you are getting values from ? |
 |
|
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2010-12-23 : 10:03:40
|
| The values from our Corporate ldap tables |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-12-23 : 11:37:12
|
| If there is relationship between both the tables then you can do inner join and update it in single statement.In case you are having issue the please provide some sample data for both the tables (contact & corporate) and whats the relationship they share. May be then we can give exact update statement to help you. |
 |
|
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2010-12-24 : 18:28:07
|
| I get the updated list of contacts information for our local contact table from our corporate active directory.It is always in the form of excel.How do i Write a query to bulk update our contact table from the excel sheet. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-27 : 08:09:51
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926MadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-12-27 : 08:56:04
|
There is RedGate DataCompare and Atlantis Visual Inspector. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2010-12-27 : 10:24:47
|
| Thanks everyone for posting the links,were helpful |
 |
|
|
|