I have a list of IDs in a CSV file (portal.txt) and which I am using within a SQL Query.
So first I am creating a temporary table as follows:
create table #tmptable2
Then populating the table as follows:
Bulk insert #tmptable2
with (FieldTerminator=',', RowTerminator = ',')
So if I now run Select Product_id from #tmptable2 it returns the 3 lines in portal.txt. All good so far. But when I run the following query I only get 1 of the 3 lines returned.
WHERE product_id in (SELECT product_id FROM #tmptable2)
Must be missing something but can't see what it is. Can anyone pont me in the right direction please?