Select IDs according to CSV file I have a CSV file with IDs of rows. I want to use that to make a SELECT statement selecting the IDs within that CSV file.

There is 1 million rows and I want to select about 95,000 of those. 

I want to SELECT and import these rows to another SQL Server database using the SQL Server Import and Export Wizard. 

I'm using MSSQL 2005 with SQL Server Management Console.
Probably best to:


Import the entire CSV to a table using Import and Export Wizard.
Run the query to pull the data you want from the table.
Use the Import and Export Wizard to import to the other database.
Clean up the CSV import, probably by truncating or deleting the table.


Unless you want to use SSIS? Then you can design a package to do it easily without importing the whole file directly.