rsbutterfly16
IS-IT--Management
hi guys i am trying to create a procedure that check if data in a column (NumberID) form view [ID CR Alert] exist in two different views i created. If it does'nt exist in view [Existing IDs] then to look in second view [Existing ShipTos], this is what i have so far...
in first view i need to commpare:
dbo.[ID CR Alert]. NumberID = dbo.[Existing IDs].[BillToID] -if it doesn't exist in this view then go to second view, if it does then do nothing:
dbo.[ID CR Alert]. NumberID = dbo.[Existing IDs].[BillToID]
CREATE PROCEDURE [ID CR Alert] AS
SELECT DISTINCT
TOP 100 PERCENT dbo.[ID CR Alert].ReferenceID, dbo.[ID CR Alert].DistributorID,
dbo.[ID CR Alert]. NumberID FROM dbo.[ID CR Alert] CROSS JOIN
dbo.[Existing MAS IDs]
WHERE (NOT EXISTS
(SELECT [BillTo]
FROM dbo.[Existing IDs]
WHERE dbo.[Existing IDs].[BillToID] = dbo.[ID CR Alert]. NumberID))
ORDER BY dbo.[ID CR Alert].ReferenceID
GO
then i have an HTML temmplate that selects the NumberIDs that do aren't in any of these two views and sends an email.
help please
in first view i need to commpare:
dbo.[ID CR Alert]. NumberID = dbo.[Existing IDs].[BillToID] -if it doesn't exist in this view then go to second view, if it does then do nothing:
dbo.[ID CR Alert]. NumberID = dbo.[Existing IDs].[BillToID]
CREATE PROCEDURE [ID CR Alert] AS
SELECT DISTINCT
TOP 100 PERCENT dbo.[ID CR Alert].ReferenceID, dbo.[ID CR Alert].DistributorID,
dbo.[ID CR Alert]. NumberID FROM dbo.[ID CR Alert] CROSS JOIN
dbo.[Existing MAS IDs]
WHERE (NOT EXISTS
(SELECT [BillTo]
FROM dbo.[Existing IDs]
WHERE dbo.[Existing IDs].[BillToID] = dbo.[ID CR Alert]. NumberID))
ORDER BY dbo.[ID CR Alert].ReferenceID
GO
then i have an HTML temmplate that selects the NumberIDs that do aren't in any of these two views and sends an email.
help please