[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Transaction With SqlBulkCopy and SqlStatement OR Map a Specific Value using SQLBulkCopy

I need to do one of two things:

1) Map a specific value to a field in my DB using sqlBulkCopy (ie 1 = FieldName)
OR
2) Create a transaction which will effectively lock my table while I bulk copy data into my db, then update those records with a known guid that i created in my .NET code.  I need that guid to keep things straight between a file name, the field in the DB belonging to that file and a bunch of other things I won't go into.

Code Needed Please!!!
0
davidcahan
Asked:
davidcahan
1 Solution
 
SystemExpertCommented:
Hi,

Bulk copy operations can be performed as isolated operations or as part of a multiple step transaction. This latter option enables you to perform more than one bulk copy operation within the same transaction, as well as perform other database operations (such as inserts, updates, and deletes) while still being able to commit or roll back the entire transaction.

http://msdn2.microsoft.com/en-us/library/tchktcdk(VS.80).aspx

Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now