You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/07/08 14:26:16 UTC

[GitHub] [druid] santiagoguinle commented on issue #11418: "FOR UPDATE" sql command is in the wrong place

santiagoguinle commented on issue #11418:
URL: https://github.com/apache/druid/issues/11418#issuecomment-876485427


   @FrankChen021 thanks for your answer! i am not also a SQLServer expert but i found some explanations about this issue
   
   Acording to this: https://stackoverflow.com/questions/1483725/select-for-update-with-sql-server
   
   An aproximated solution for "FOR UPDATE" in SQLServer is using "WITH (UPDLOCK)" but in fact if you want to just lock some specific rows then you need to define an index and use it on the same SQL expression.
   
   For example create an index like this:
   
   CREATE INDEX TBLINDEX ON TBL ( id )
   
   and then lock only row with id 10 doing this:
   
   SELECT * FROM TBL WITH (UPDLOCK, INDEX(TBLINDEX)) WHERE id=10.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org