0

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.

2

Probably best to:

  1. Import the entire CSV to a table using Import and Export Wizard.
  2. Run the query to pull the data you want from the table.
  3. Use the Import and Export Wizard to import to the other database.
  4. 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.

  • Thank you! I don't really now anything about SQL Server, just MySQL. I will try to find some documentation about SSIS and see if I can use it. – Simon Fredsted Jul 28 '14 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.