0

我在存储过程中有一个代码,它需要加入逗号熟食字符串列。我试过了,但它无法被 sql server 识别。请让我知道正确的方法。这是存储过程中的代码:

INSERT INTO CPE_EXT_Downloaded (FileName, LocalServerID, WaitingACK, CreationDate, FileSize, MD5, ErrorMsgTime, LocationID, OfferID)  
    SELECT 
       cip.FileName, LS.LocalServerID, cip.WaitingACK, cip.CreationDate, 
       cip.FileSize, cip.MD5, cip.ErrorMsgTime, ILV.LocationID, cip.OfferID   
    FROM 
       @WorkSet ws       
    INNER JOIN 
       CPE_IncentiveDLBuffer_Pending cip WITH (NOLOCK) ON cip.POID = ws.POID
    INNER JOIN 
       CPE_IncentiveLocationsView AS ILV WITH (NOLOCK) ON ILV.IncentiveID = cip.OfferID 
    INNER JOIN 
       LocalServers AS LS WITH (NOLOCK) ON LS.LocationID = ILV.LocationID  
    CROSS APPLY on 
       dbo.split(cip.LocationGroups, ',') AS ST ON st.items = ILV.LocationID
    WHERE
       LS.MustIPL = 0 
4

1 回答 1

0

您是否考虑过定期加入?

        FROM @WorkSet ws       
        INNER JOIN CPE_IncentiveDLBuffer_Pending cip WITH (NOLOCK)
        on cip.POID = ws.POID
        inner join  CPE_IncentiveLocationsView as ILV WITH (NOLOCK)
        on ILV.IncentiveID= cip.OfferID and
           ','+cip.LocationGroups+',' like '%,'+ILV.LocationId+',%'
        Inner Join LocalServers as LS with (NoLock) on LS.LocationID=ILV.LocationID  
于 2012-12-07T14:23:52.247 回答