I would like to import a csv file into an empty table in SQL Server Developer 2016, using Task Wizard. I know with BULK INSERT there are options to specify firstrow and lastrow; does Import Wizard have a similar feature?
-
1Pretty sure there is an option to skip x rows....probably the first x, not from say 100-200..Kevin3NF– Kevin3NF2017年07月12日 15:05:27 +00:00Commented Jul 12, 2017 at 15:05
-
Right. I was wondering if I was missing s range option. Oh well.Bad Programmer– Bad Programmer2017年07月12日 18:48:01 +00:00Commented Jul 12, 2017 at 18:48
-
Did you get what you needed?Kevin3NF– Kevin3NF2017年07月17日 19:54:46 +00:00Commented Jul 17, 2017 at 19:54
2 Answers 2
The wizard only has the option to skip the first x rows...more complex than that would need to be a regular SSIS package, or some pre-processing of the file before the wizard picks it up.
Alternatively, import the whole file to a staging table and then trash the rows you don't need, or push the ones you do want into the correct destination table in a T-SQL statement.
Just as I suspected, task wizard does not have the ability to select import range. I ended up using bulk import and using the FIRST_ROW and LAST_ROW options.