|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I am using Sql Server 2005 and found a problem with importing csv files that
I don't believe happened in 2000. If I am importing a .csv file, it will assume that I want to output char(50) for every single field. I understand that it doesn't know what the columns sizes (or types) are when you first tell it which flat file to use. But then you tell it what the output table is and it correctly shows you what the column types and lengths are. But it still trys to ouptut each fields as char(50), even in a datetime field. So it crashes. You need to go back to where you told it what flat file you wanted, select advanced from the left pane and then proceed to change all 40 columns (in my case) to the correct sizes and types. Is there a way to tell it to use the sizes and types it found in the table? Then if the sizes were still too large - fine. Or give you an option to truncate it. Thanks, Tom |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"tshad" <tshad@dslextreme.com> wrote in message news:O5pnBGZzIHA.1772@TK2MSFTNGP03.phx.gbl... >I am using Sql Server 2005 and found a problem with importing csv files >that I don't believe happened in 2000. > > If I am importing a .csv file, it will assume that I want to output > char(50) for every single field. > > I understand that it doesn't know what the columns sizes (or types) are > when you first tell it which flat file to use. But then you tell it what > the output table is and it correctly shows you what the column types and > lengths are. > > But it still trys to ouptut each fields as char(50), even in a datetime > field. > > So it crashes. > > You need to go back to where you told it what flat file you wanted, select > advanced from the left pane and then proceed to change all 40 columns (in > my case) to the correct sizes and types. > > Is there a way to tell it to use the sizes and types it found in the > table? > > Then if the sizes were still too large - fine. Or give you an option to > truncate it. > > Thanks, > > Tom Hi Tom I don't have to re-specify column data types with the import wizard and defaults to 50 characters only seem to occur if I don't specify an existing table. Which version are you on? Have you tried saving this as a SSIS package and just re-using that? John |
|
![]() |
| Outils de la discussion | |
|
|