Larry Brister
asked on
SQL Server Select on LT running Totals
In the sql below I get a count by CampaignID
What I would like to do is set an update and set vendorServer = 1 on all rows where the running total < 125,000
SQL Server version is 2012
What I would like to do is set an update and set vendorServer = 1 on all rows where the running total < 125,000
SQL Server version is 2012
SELECT CampaignID, CurrentCount, vendorServer
FROM dbo.Campaigns
WHERE schedStatus = 'ACTIVE' AND stat = 0
Define 'running total' in the context of the above T-SQL statement, preferably with some sample data.
CurrentCount is the column that has the running total?
If so, then you can try this:
If so, then you can try this:
UPDATE Campaigns
SET vendorServer=1
WHERE CurrentCount < 125000
NOTE: Test it before in a development environment before running the code in Production.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very nice guys... both work