Question: I have a image with a ID.
IF someone click on that image a .HTML must slide up or fade in on the same page.
The .HTML page have also a close button so they can close the HTML page

But how can i show the .HTML page with jQuery or Javascript?

I want something like this :
<http://elitemodel.fr/fr/mainboard/women>

If you click on a photo, (a .html page will slide up with the information)
I a have everything done, except the code for showing the .HTML page

I have tried this but no results :

```
$(document).ready(function(){
    $('#ams2t').click(function(){   
        $('#body').load('pictures/amsterdam1.html');
     });
});

```

ams2t is the id of the image : `<img id="ams1t" class="thumb" src="images/amsterdam/thumb/ams1.jpg" alt="" />`

So if some click on that picture..
picuture/amsterdam1.html must slide UP or Fade in

Something like this :

```
$("#ams1t").click(function () {
   $('#ams1').slideDown( "slow", function() {
     });
});

```

Answer: 
I think you should be able to do this atomically using a common table expression. (I'm not 100% certain about this, and I haven't tested, so you'll need to verify that it works for you in your situation.)

```
;WITH cte AS
(
    SELECT TOP(@ArrayCount)
        ID, Exported, ExportExpires, ExportSession
    FROM dbo.GameData WITH (READPAST)
    WHERE Exported IS NULL
    ORDER BY ID
)
UPDATE cte
SET Exported = @Now,
    ExportExpires = @Expire,
    ExportSession = @ExportSession
OUTPUT INSERTED.ID INTO @ExportedIDs

```
It does not work because multiple transactions might first execute the IN clause and find the same set of rows, then update multiple times and overwrite each other.

LukeH's answer is best, accept it.

You can also fix it by adding `AND Exported IS NULL` to cancel double updates.

Or, make this `SERIALIZABLE`. This will lead to some blocking and deadlocking. This can safely be handled by timeouts and retry in case of deadlock. `SERIALIZABLE` is **always** safe for all workloads but it might block/deadlock more often.