March 25, 2005 at 9:45 am
I am running an application on SQL Server 2000 with a Transaction Isolation Level of Serializable (which cannot be changed). I have a table that has a varbinary column, with an index on this column. I hvae two simultaneous users within their own Serialized Transactions. User 1 runs "select * from myTable where myVarBinaryColumn = @Value1" then runs an insert statement on this table "insert into myTable set myVarBindaryColumn = @Value1"
User2 does the same thing but uses a different value for @Value1. I get a locking error when I try this even though there is an index on the column. This query doesn't lock if the column is an int field or varchar. Is there a problem with indexing varbinary fields?
March 27, 2005 at 4:25 pm
What is the error and what is the actual query that is experiencing the error?
The only issue with indexing any variable length field (varchar, varbinary, etc.) is that it can't exceed 900 bytes.
March 28, 2005 at 7:59 am
Have you tried setting up the granularity to the row?
ex: "select * from myTable with (rowlock) where myVarBinaryColumn = @Value1
This statement is invalid:
insert into myTable set myVarBindaryColumn = @Value1
If you were trying to perform an update then replace it with
update myTable with (rowlock) set myVarBindaryColumn = @Value1
HTH
* Noel
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply