Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Sunday, February 19, 2012

Concurrent Insert and Update Commands

Hi there,

I've had a look at this thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=104399&SiteID=1 - but it's a bit old so I thought I'd try to clarify a couple of things.

I have a data flow which inserts or updates a table in a SQL 2000 database.

The insert is done via an OLE DB destination and the update is done via an OLE DB Command.

As stated in the previous thread, when these commands run concurrently issues arise with blocking etc.

The only way I've managed to get around it is by setting the access mode of the insert to OpenRowset.

So 2 questions:

1) Does anyone know how this problem occurrs and what the best way to get around it is?

2) Are there issues around NOT using the fast load options - I've read stuff about the double-byte character set etc but I admit I don't quite understand it.

Thanks.

I personally prefer to push my data to be updated into a raw file and then do the update in a seperate data-flow.

-Jamie

|||

Some points that might help:

Using Fast load defaults to having table lock on. You can turn table lock off (and keep Fast load.)

Tuesday, February 14, 2012

Concurrency

Do single commands (or stored procedures) execute concurrently, or they are executed one by one. How do you perform a lock during the execution of a command (or stored procedure).

Single commands are 'implied' transactions, that is the command executes completely, or nothing is done.

For multiple commands, where there is a need to make sure the several statements execute in a 'all or nothing' scenario, use TRANSACTIONS.

Refer to Books Online, Topic: Transactions

|||

Other good topics in the BOL are "Isolation mode" and locking hints.

Jens K. Suessmeyer.


http://www.sqlserver2005.de