Microsoft
Software
Hardware
Network
Question : Updating Multiple rows
I want update 12 carore records. I want to update from record 1 to 5000, then from 5001 to 10000, then from 10001 to 15000 and so on. How to do it in a loop. Query is here but it always update first 5000. How to update next 5000 record from 50001 to 10,000 and then from 10,001 to 15000.
SET ROWCOUNT 5000
WHILE (1=1) BEGIN
BEGIN TRANSACTION
update newformularydtl
set newformularydtl.ddid=b.ddi
d from newformularydtl a,Medispan.dbo.mmw_drug_pa
ck b
where a.ProductID=b.ppid
IF @@ROWCOUNT = 0
BEGIN
COMMIT TRANSACTION
BREAK
END
COMMIT TRANSACTION
END
Answer : Updating Multiple rows
where a.ProductID=b.ppid
and a.ddid <> b.ddid
Posted via EE Mobile
Random Solutions
Convert numbers to text
Dealing with Corrupted System Files on Vista
Can't email more than one invoice from Quickbooks Pro 2006 in Outlook
Access - SQL user parameter entry
Access form - Using Sum function to validate records
error installing ajaxcontroltoolkit - 'there was an error loading types or assembly...'
Strip out ’s in mySQL query | XML Parsing Error: undefined entity
Protect Store Procedures in SQL 2000 & 2005
Pass recordset from local sql server to remote sql server using access adp
vmware player shows black screen on win 2003 server