Advertisement
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: |
- Adds a Delinquency Alert to Orgs w/ Delinquent Royalties
CREATE PROCEDURE SetDelinquentRoyaltyAlerts AS
-- Declare variables
DECLARE @Message varchar(200)
DECLARE @Temp varchar(100)
-- Set Delinquent Customer Messages
SET @Message = 'This customer has delinquent royalties. Check with licensing (Sharon Burns '
SET @Message = @Message + 'licensing@LEADTOOLS.com) before making credit sale or giving technical support. '
-- Set Delinquent Customer Message LIKE search patterns
SET @Temp = '%' + 'This customer has delinquent royalties. Check with licensing' + '%'
/********************************************************************************************************************/
-- Add Delinquent Message to Alert Field of Orgs w/ Delinquent Royalties
UPDATE Org
SET ChangeDate = GETDATE(), ChangeUser = 'SQLDAIMON', Alert = @Message + ISNULL(Alert, '')
FROM Org o JOIN Royalty r ON o.Org_ID = r.Org_ID
WHERE (r.Status = 'Delinquent' OR r.Status = 'Multimedia Delinquent')
AND (Alert NOT LIKE @Temp OR Alert IS NULL)
AND o.CustNo IS NOT NULL
-- Remove Delinquent Message from Alert Field of Orgs w/ Formerly Delinquent Royalties
UPDATE Org
SET ChangeDate = GETDATE(), ChangeUser = 'SQLDAIMON', Alert = REPLACE(Alert, @Message, '')
FROM Org o JOIN Royalty r ON o.Org_ID = r.Org_ID
WHERE o.Org_ID NOT IN (SELECT DISTINCT Org_ID FROM Royalty WHERE Status IN ('Delinquent', 'Multimedia Delinquent'))
AND Alert LIKE @Temp
/********************************************************************************************************************/
-- Cleanup After Previous UPDATE Statement
-- Set Zero-length String Alert Fields to NULL
UPDATE Org
SET ChangeDate = GETDATE(), ChangeUser = 'SQLDAIMON', Alert = NULL
WHERE Alert = ''
GO
|
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
|
Loading Advertisement... |