Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Prepping large lists for use with the IN Operator

$
0
0

We frequently have to run a query on a specific listing of comptuer names, typically using the IN Operator and ('Name1', 'Name2', etc.).

Am looking for a way both to speed up the placing of the names into the required formatting, and to also remove the CRLF between them (they come mostly from Excel lists, so one per row) to make the code at least look neater (and spend less time typing), i.e.,:

Name1

Name2 

Etc.      to:  ('Name1', 'Name2', 'etc.')

Any way to automate?

Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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