Quantcast
Viewing all articles
Browse latest Browse all 4871

How to run select statement with a list of where value SQL 2008?

I have a list of PO numbers that is in a text file:

textfile.txt
12323
53221
23953
20391
10393
etc.
etc..

Here is the statement I am running

select dbo.PurchaseOrder.SiteID from dbo.PurchaseOrder where dbo.PurchaseOrder.PONumber = '12323'

This statement will give me the output of the value. But how I make it so it run all the PO number in the textfile.txt file without me having to run it one by one.

Thanks in advance..


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>