我正在使用SQL Server 2008
我有这个INSERT语句
INSERT INTO [dbo].[TempSequences]
(Title, Sequence, FileTrackingTag)
SELECT Title, Sequence, FileTrackingTag
FROM [dbo].[MasterSequence]
WHERE charindex(',' + FileTrackingTag + ',', ',' + @filetag + ',') > 0;
其中FileTrackingTag是与所述标题和序列相关联的那个。但是我给它一串这些标签
即
'tag1,tag2,tag3,tag4'
如何在其中放置正确的标签?感谢
答案 0 :(得分:0)
如果你的意思是你想通过参数而不是整个序列只放置一个提供的标签,那么:
INSERT INTO [dbo].[TempSequences]
(Title, Sequence, FileTrackingTag)
SELECT Title, Sequence, @filetag
FROM [dbo].[MasterSequence]
WHERE charindex(',' + FileTrackingTag + ',', ',' + @filetag + ',') > 0;