Question : T-SQL Update Ordering by IDs based on a random number column

Update rm.Juror
SET @Counter = JuryRollNumber = @Counter + 1, JuryStatusTypeId = 1  SelectedJuryDistrictId = 1
OUTPUT inserted.JuryRollNumber
Where [JurorId] in (Select Top(@RowCount) JurorId From rm.Juror
Where JuryDistrictId = 1 and SelectedStateDistrictId = 1 and JuryStatusTypeId != 1
ORDER by JuryPoolRandomNumber ASC)

I'm creating a store proc which needs to update a table based on the random number. I need to order by the random number and then give a roll number for each person based on the order of the random numbers.

The update statement I have atm works for 200 odd rows then gives up and just does it in any random order how can I fix this?

Answer : T-SQL Update Ordering by IDs based on a random number column

Hi ,
Try These  Example:
<html>
<head>
<script language="javascript" type="text/javascript">
 // It USed to add new inner content your Existing div "DivEx"
 function show_prompt()
 {
   var str=prompt("Please enter Div input Text:");
         if (str!=null && str!="" && str !='undefined' )
        {
             var divobj=document.getElementById("DivEx");
                    divobj.innerHTML=str;      
        }
 }
 // It Used to add new div in your Existing Div "DivEx" , It s Addtional examples

function addElement() {
  var ni = document.getElementById('DivEx');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById('theValue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  newdiv.innerHTML = 'I am Your New Div:' + divIdName;
  ni.appendChild(newdiv);
}

</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Enter Input Box" />
<input type="button" onclick="addElement()" value="CreateInnerDiv" />
<input type="hidden" value="0" id="theValue" />
<div id="DivEx">INACTIVE</div>
</body>
</html>
Random Solutions  
 
programming4us programming4us