sqlcurious
asked on
query taking a lot of time
WITH ISO_DR(PolicyID, CompanyID, Persistency) AS
(SELECT P.policyID, P.companyID, (SELECT effectiveDate from dbo.Policy where policyID =(select dbo.fnOriginalPolicyID(@po licynum))) as PERSISTENCY
FROM Hallmark..Policy P WITH (NOLOCK))
Is there a better way to write this?
(SELECT P.policyID, P.companyID, (SELECT effectiveDate from dbo.Policy where policyID =(select dbo.fnOriginalPolicyID(@po
FROM Hallmark..Policy P WITH (NOLOCK))
Is there a better way to write this?
please post the actual query you are using ... you've only posted the cte
also post the definition of dbo.fnOriginalPolicyID
is this a cross database query?
or are the policy tables actually the same one?
or are the policy tables actually the same one?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry, forgot the ; before the WITH
Anny feedback?
ASKER
thnks