我在存储过程中有一个代码,它需要加入逗号熟食字符串列。我试过了,但它无法被 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