Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Bulk update in sql table

Author  Topic 

nileshhthakur2004
Starting Member

1 Post

Posted - 2014-03-14 : 02:29:43
Hello All,

I want to update data in sql table depends on some condition (field1 and field2 comming from excel).
I am getting excel sheet in which two coulmns (field1 and field2) are comming from client ( 400 Records) and want to change value of field say Status = c depends on these comming records from client.

Client is sending excel sheet with 400 field and want to change value for all 400 records with unique fields (field1 and field2) comming in that excel sheet...

How can i write and update records as Bulk.
Instaed updating one one recors ?

Example ( Update Table_Name Set Status = 'c' Where Field1 = Value from Excel for Field1 and
Field1 = Value from Excel for Field2)

Same needs to do for 400 records...
Any help will wellcome.


Thanks,
Nilesh....

Thanks,
Nilesh Thakur.

Robowski
Posting Yak Master

101 Posts

Posted - 2014-03-14 : 08:40:31
some sample data and an example would make it easier to answer but on the fly, bulk insert it into a #HashTable and update it like that?
Go to Top of Page
   

- Advertisement -