| 
 Posted by David Portas on 11/15/05 19:33 
1. You certainly ought to do this set-based rather than row by row as 
your code fragment implied. What you can also do is batch the UPDATEs 
into X rows at a time. For example: 
 
SET ROWCOUNT 50000 
 
WHILE 1=1 
 
BEGIN 
 
 UPDATE dataTable 
  SET fieldE = 'fieldE_valueF' 
  WHERE EXISTS 
   (SELECT * 
    FROM dataTable AS T 
    WHERE fieldA = 'fieldA_valueB' 
     AND T.fieldC = dataTable.fieldC 
     AND T.fieldD = dataTable.fieldD); 
 
 IF @@ROWCOUNT = 0 BREAK 
 
END 
 
SET ROWCOUNT 0 
 
2. Why would you want to do audit logging in the front end? I don't 
understand the question. 
 
3. What is your reason for wanting dynamic code rather than static? 
This just comes down to change management controls. Dynamically 
altering fundamental chunks of business logic without a release and 
test cycle is a great recipe for really screwing things up. Would you 
consider doing the same thing for C# code? I don't think so. 
 
--  
David Portas  
SQL Server MVP  
--
 
  
Navigation:
[Reply to this message] 
 |