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)
 problem with simple import sql server 2005

Author  Topic 

jpotucek
Constraint Violating Yak Guru

273 Posts

Posted - 2009-12-21 : 20:47:12
I am try to do a simple import of a few rows into an empty table and i am beyond frustrated.

Here is my Table

Create table dbo.Results (
RESULTS_DATE datetime not null,
TARGET int not null,
VALUE int not null,
SCALED_TARGET int null,
SCALED_VALUE int not null,
SUBJECT VARCHAR(18) not null,
TECHNIQUE CHAR(10) not null,
NR_PERIODS int not null) ;
Here is the data that I am trying to import.

01042010,780,780,273000,273000,ingenium,UPTIME,1
01052010,780,780,273000,273000,ingenium,UPTIME,1
01062010,780,738,273000,258300,ingenium,UPTIME,1
01072010,780,780,273000,273000,ingenium,UPTIME,1
01082010,780,780,273000,273000,ingenium,UPTIME,1
01092010,300,300,105000,105000,ingenium,UPTIME,1
01042010,0,0,0,0,ingenium,WINDOW,1
01052010,0,35,0,12250,ingenium,WINDOW,1
01062010,0,0,0,0,ingenium,WINDOW,1
01072010,0,0,0,0,ingenium,WINDOW,1
01082010,0,0,0,0,ingenium,WINDOW,1
01042010,780,780,78000,78000,life70,UPTIME,1
01052010,780,780,78000,78000,life70,UPTIME,1
01062010,780,780,78000,78000,life70,UPTIME,1
01072010,780,780,78000,78000,life70,UPTIME,1
01082010,780,780,78000,78000,life70,UPTIME,1
01092010,300,280,30000,28000,life70,UPTIME,1
01042010,0,0,0,0,life70,WINDOW,1
01052010,0,0,0,0,life70,WINDOW,1
01062010,0,0,0,0,life70,WINDOW,1
01072010,0,0,0,0,life70,WINDOW,1
01082010,0,0,0,0,life70,WINDOW,1
01052010,0,0,0,0,AF_Series,WINDOW,1
01062010,0,0,0,0,AF_Series,WINDOW,1
01072010,0,0,0,0,AF_Series,WINDOW,1
01082010,0,60,0,60,AF_Series,WINDOW,1
01092010,0,0,0,0,AF_Series,WINDOW,1
01052010,0,0,0,0,FR_Series,WINDOW,1
01062010,0,0,0,0,FR_Series,WINDOW,1
01072010,0,0,0,0,FR_Series,WINDOW,1
01082010,0,0,0,0,FR_Series,WINDOW,1
01092010,0,0,0,0,FR_Series,WINDOW,1
01032010,0,3,0,4200,Agent_Portal,TASK,1
01042010,0,0,0,0,Agent_Portal,TASK,1
01052010,0,2,0,2800,Agent_Portal,TASK,1
01062010,0,1,0,1400,Agent_Portal,TASK,1
01072010,0,0,0,0,Agent_Portal,TASK,1
01032010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01042010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01052010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01062010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01072010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01082010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01092010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01102010,1440,1440,2016000,2016000,Agent_Portal,UPTIME,1
01062010,0,18,0,25200,Agent_Portal,RELEASE,1
01072010,0,0,0,0,Agent_Portal,RELEASE,1
01082010,0,0,0,0,Agent_Portal,RELEASE,1
01112010,0,0,0,0,Agent_Portal,RELEASE,1
01122010,0,0,0,0,Agent_Portal,RELEASE,1
01132010,0,3,0,4200,Agent_Portal,RELEASE,1
01142010,0,0,0,0,Agent_Portal,RELEASE,1
01152010,0,0,0,0,Agent_Portal,RELEASE,1
01192010,0,0,0,0,Agent_Portal,RELEASE,1
01202010,0,0,0,0,Agent_Portal,RELEASE,1
01212010,0,0,0,0,Agent_Portal,RELEASE,1
01042010,540,540,54000,54000,VersionMgr,UPTIME,1
01052010,540,540,54000,54000,VersionMgr,UPTIME,1
01062010,540,540,54000,54000,VersionMgr,UPTIME,1
01072010,540,540,54000,54000,VersionMgr,UPTIME,1
01082010,540,480,54000,48000,VersionMgr,UPTIME,1
01042010,0,0,0,0,VersionMgr,REPAIR,1
01052010,0,0,0,0,VersionMgr,REPAIR,1
01062010,0,0,0,0,VersionMgr,REPAIR,1
01072010,0,0,0,0,VersionMgr,REPAIR,1
01082010,0,60,0,6000,VersionMgr,REPAIR,1
01092010,0,0,0,0,VersionMgr,REPAIR,1
01032010,1320,1320,462000,462000,DWDB,UPTIME,1
01042010,1320,1320,462000,462000,DWDB,UPTIME,1
01052010,1320,1320,462000,462000,DWDB,UPTIME,1
01062010,1320,1320,462000,462000,DWDB,UPTIME,1
01072010,1320,1320,462000,462000,DWDB,UPTIME,1
01082010,1320,1320,462000,462000,DWDB,UPTIME,1
01092010,1200,1110,420000,388500,DWDB,UPTIME,1
01092009,0,15,0,15,SGA,WINDOW,1
01042009,0,42,0,1680,PDR,WINDOW,1

When I attempt to import via the MGT Studio GUI, I get this error:

Warning 0x802092a7: Data Flow Task: Truncation may occur due to inserting data from data flow column "Column 5" with a length of 50 to database column "SUBJECT" with a length of 18.
(SQL Server Import and Export Wizard)

Warning 0x802092a7: Data Flow Task: Truncation may occur due to inserting data from data flow column "Column 6" with a length of 50 to database column "TECHNIQUE" with a length of 10.
(SQL Server Import and Export Wizard)

Warning 0x802092a7: Data Flow Task: Truncation may occur due to inserting data from data flow column "Column 5" with a length of 50 to database column "SUBJECT" with a length of 18.
(SQL Server Import and Export Wizard)

Warning 0x802092a7: Data Flow Task: Truncation may occur due to inserting data from data flow column "Column 6" with a length of 50 to database column "TECHNIQUE" with a length of 10.
(SQL Server Import and Export Wizard)

I don't see anything wrong with the data.. can anyone help?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-21 : 21:31:39
Can you provide us the actual INSERT statements so that we can try too?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-21 : 21:40:47
Nevermind just noticed you are using the import wizard. I can't spot anything wrong in your data, so I assume that you've got a badly formatted file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-22 : 01:16:53
Hi

My guess: You do a string datatype transformation If your source data is longer than SUBJECT column 18 characters and TECHNIQUE column 10 characters . Please check the source data length and change your datatype size.



-------------------------
R...
Go to Top of Page

timh141
Starting Member

1 Post

Posted - 2010-01-02 : 16:39:07
this person has a legitimate problem, i have the same problem which is how i found this post. Can you provide more detail on how to fix this? The database is in use, I'm just trying to speed up loading it by using a .csv file instead of a sql insert statement, and instead of that helping, I get a new error.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-01-03 : 02:24:50
timh141 , are you getting this error doing just an INSERT statement?

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-01-03 : 02:31:54
Try the following :
1)Assuming you are using the Import\Export Wizard, select Advanced and alter the OutputColumnWidth - for problematic columns, ensuring they are the same wodth as your table columns
2)If the above doesn't work , try to import and allow the table to be create automatically


Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -