JaybeeinTekTips
Technical User
Hi all,
I've got some code here that runs for about a minute without the red entries, but for 100 minutes (and more) with them - any ideas, people?
Thanks,
Jaybee.
SET NOCOUNT ON ;
Select DISTINCT (tblAccounts.accountID) ,
tblAccounts.accountFirstName ,
tblAccounts.accountLastName,
tblServicesTree.serviceName,
tblcommunicationsSent.SentTo
FROM dbo.fn_getValidSubscriptions() as vs
JOIN tblAccounts on tblAccounts.accountID = vs.accountID
JOIN tblServicesTree on tblServicesTree.serviceID = vs.serviceID
JOIN tblcommunicationsSent on tblcommunicationsSent.accountID = vs.accountID
WHERE tblAccounts.accountEnabled <> 0 AND tblAccounts.accountSubscriptionsEnabled <> 0
and tblAccounts.accountID <> 3159
AND tblAccounts.ntUserID NOT IN ('Domain1','Domain2','Domain3')
order by tblAccounts.accountLastname, tblAccounts.accountFirstname
I've got some code here that runs for about a minute without the red entries, but for 100 minutes (and more) with them - any ideas, people?
Thanks,
Jaybee.
SET NOCOUNT ON ;
Select DISTINCT (tblAccounts.accountID) ,
tblAccounts.accountFirstName ,
tblAccounts.accountLastName,
tblServicesTree.serviceName,
tblcommunicationsSent.SentTo
FROM dbo.fn_getValidSubscriptions() as vs
JOIN tblAccounts on tblAccounts.accountID = vs.accountID
JOIN tblServicesTree on tblServicesTree.serviceID = vs.serviceID
JOIN tblcommunicationsSent on tblcommunicationsSent.accountID = vs.accountID
WHERE tblAccounts.accountEnabled <> 0 AND tblAccounts.accountSubscriptionsEnabled <> 0
and tblAccounts.accountID <> 3159
AND tblAccounts.ntUserID NOT IN ('Domain1','Domain2','Domain3')
order by tblAccounts.accountLastname, tblAccounts.accountFirstname