Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 error in importing csv file

Author  Topic 

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-01 : 15:09:53
I have an almost large csv file and want to import it into the sql server 2005 but it is not possible!
I tell you what i do for importing step by step and please guide me if i do wrongly in each step:

1-I right clicked on a database, chose task/import data...
2-in the import/export wizard, in the data source part, i chose flat file source as data source _ browsed and chose the csv file for the filr name and didnt change the format and clicked on the next button
3- in the destination part, chose SQL Native client as destination,and cliked on new... button to create a new data base for destination and named it as new. then clicked next button
4- finish

it started to convert, the status of options before validating were success and after it(prepare for execute, pre execute,copying [new].[dbo].[amlak], post execte and clean up) were stopped and status of Execute was error

the Error was:

TITLE: SQL Server Import and Export Wizard
------------------------------

Error 0xc002f210: Preparation SQL Task: Executing the query "CREATE TABLE [new].[dbo].[amlak] (
[C__REG] string [DT_STR],
[REGION_NO] string [DT_STR],
[BLOCK_NO] string [DT_STR],
[LAND_NO] string [DT_STR],
[APARTMENT_NO] string [DT_STR],
[OLD_REG_NO] string [DT_STR],
[FIRST_NAME] string [DT_STR],
[LAST_NAME] string [DT_STR],
[PATH_ADDRESS] string [DT_STR],
[PLATE_NO] string [DT_STR],
[PHONE_NO] string [DT_STR]
)
" failed with the following error: "Incorrect syntax near 'DT_STR'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


please help me.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 01:29:31
did you check the query it produced when you clicked new?what was query it generated?
Go to Top of Page

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-02 : 01:43:27
the qury is this:

CREATE TABLE [new].[dbo].[amlak] (
[C__REG] NVARCHAR(50),
[REGION_NO] NVARCHAR(50),
[BLOCK_NO] NVARCHAR(50),
[LAND_NO] NVARCHAR(50),
[APARTMENT_NO] NVARCHAR(50),
[OLD_REG_NO] NVARCHAR(50),
[FIRST_NAME] NVARCHAR(50),
[LAST_NAME] NVARCHAR(50),
[PATH_ADDRESS] NVARCHAR(50),
[PLATE_NO] NVARCHAR(50),
[PHONE_NO] NVARCHAR(50)
)

it seems ok. isnt it?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 02:03:26
i think the probelm is because DT_STR is missing values for codepage and length parameters. try giving 50,1252 as values
Go to Top of Page

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-02 : 02:57:02
where should i give 50,1252?

i made a database by my own and didnt click on new button to made it. this time validating had error and executing status was success.
the error is:


- Validating (Error)
Messages
Error 0xc00470fe: Data Flow Task: The product level is insufficient for component "Source - amlaktehran_csv" (1).
(SQL Server Import and Export Wizard)

Error 0xc00470fe: Data Flow Task: The product level is insufficient for component "Data Conversion 1" (71).
(SQL Server Import and Export Wizard)


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 03:16:08
what's your source file version?
Go to Top of Page

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-02 : 03:30:26
I think it is excel2003 but i am not sure. some body gave the file on a cd to me. how can i find the version? sorry if my question is so primary
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 03:49:25
quote:
Originally posted by Exir

I think it is excel2003 but i am not sure. some body gave the file on a cd to me. how can i find the version? sorry if my question is so primary



http://blogs.msdn.com/michen/archive/2006/11/11/ssis-product-level-is-insufficient.aspx
Go to Top of Page

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-02 : 08:32:14
when i looked at computer management the sql integration service was not there, does it mean i should install my sql server again? and not having sql server ingeration service is the reason of these errors? :(
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 08:46:43
quote:
Originally posted by Exir

when i looked at computer management the sql integration service was not there, does it mean i should install my sql server again? and not having sql server ingeration service is the reason of these errors? :(



what does that link say?
Go to Top of Page

Exir
Posting Yak Master

151 Posts

Posted - 2009-01-02 : 15:29:32
sorry, my english is not that much good. what i got from the link was that if during instalation, i didnt check SSIS part, the importation dosent work. is it correct? if yes, should i install all of sql again or i can add this part separately?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-03 : 06:59:37
quote:
Originally posted by Exir

sorry, my english is not that much good. what i got from the link was that if during instalation, i didnt check SSIS part, the importation dosent work. is it correct? if yes, should i install all of sql again or i can add this part separately?



Yup thats correct
if you havent installed ssis, you can run setup cd again and choose only integration services from menu, you dont need to install everything again.
Go to Top of Page
   

- Advertisement -