I have a table of CSV data like such:
a | b | c | d | f
1: 12 Dave Larry $1234.0 FALSE
2: 324.0 Bob Gray $24.012 TRUE
3: 2000 John Stan $204.0
4: 9000 Stace Jill - FALSE
5: 850.0 Till $30 TRUE
A field such as a user's comments would include commas, so these are escaped via single- or double-quotes. Excel opens these just fine and can be used to cleanse or manipulate the data before importing.
The easiest thing for me from a migration standpoint was to just get the data into the SQL Server as varchars first, then use SQL to manipulate the data into its target destination format.
I did run into the following problems:
1) Trying to import the CSV can cause issues. SQL Server Management Studio's import expects a strictly formatted CSV, meaning something like a comments column or numbers formatted as currency in text could cause imports to fail.
2) When saving the CSV as XLS, SQL Server Management Studio still seems to try and be "smart" about how it interprets the data, regardless of however it was formatted. Sometimes, data cannot be converted to nvarchar or varchar even if you desire that, because the import utility already assumes the data is numeric. Tab-delimited can end up not working as well, especially for something like user comments.
What is an error-free method of importing CSV to SQL Server, making all columns varchar or nvarchar?