Skip to main content
code formatting
Source Link
Nick Chammas
  • 14.8k
  • 17
  • 76
  • 123

Hope this helps anyone with the same issue:

UPDATE r SET HardwareNumber = r.NextID FROM (select 999999899 + ROW NUMBER() over (order by HardwareNumber) AS NextID,HardwareNumber FROM tblAsset WHERE HardwareNumber is NULL) r

UPDATE r
SET HardwareNumber = r.NextID 
FROM (
   SELECT 
      999999899 + ROW NUMBER() over (order by HardwareNumber) AS NextID,
      HardwareNumber 
   FROM tblAsset 
   WHERE HardwareNumber is NULL
) r;

Hope this helps anyone with the same issue

UPDATE r SET HardwareNumber = r.NextID FROM (select 999999899 + ROW NUMBER() over (order by HardwareNumber) AS NextID,HardwareNumber FROM tblAsset WHERE HardwareNumber is NULL) r

Hope this helps anyone with the same issue:

UPDATE r
SET HardwareNumber = r.NextID 
FROM (
   SELECT 
      999999899 + ROW NUMBER() over (order by HardwareNumber) AS NextID,
      HardwareNumber 
   FROM tblAsset 
   WHERE HardwareNumber is NULL
) r;
Source Link
user9435
  • 31
  • 1
  • 3

Hope this helps anyone with the same issue

UPDATE r SET HardwareNumber = r.NextID FROM (select 999999899 + ROW NUMBER() over (order by HardwareNumber) AS NextID,HardwareNumber FROM tblAsset WHERE HardwareNumber is NULL) r