Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BULK INSERT Problem
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 6.5 and older
Miscellaneous
Thread ID:
01357193
Message ID:
01357197
Views:
13
Are you using SQL Server 6.5?

If not and this is SQL Server 2005 or later, try using varchar(max) instead of the text or fixed varchar.

See also http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35526 (at the middle of the thread).

>I have the following:
>
>DROP TABLE PartsMaster
>
>CREATE TABLE PartsMaster
>( 
>    Product_Series		VARCHAR(75), 
>    Product_Number		VARCHAR(25), 
>    Product_Name		VARCHAR(75),
>    Part_Number			VARCHAR(50),
>    Category			VARCHAR(50),
>    Keyword			VARCHAR(50),
>    Part_Description	        TEXT,
>    Description			TEXT,
>    New_part_Number		VARCHAR(25),
>    Source_File			VARCHAR(50)
>)
>
>DELETE FROM PartsMaster
>
>BULK INSERT PartsMaster 
>     FROM 'D:\Projects\Clients\Abtech\Parts List\Data\Source\prg_old_3000 server.txt' 
>    WITH 
>    ( 
>        FIELDTERMINATOR = '^', 
>        ROWTERMINATOR = '\n' 
>    )
>
>UPDATE PartsMaster SET Source_File = 'prg_old_3000 server.txt' WHERE Source_File = ''
>
>
>If I leave the 'Source_File' off the CREATE TABLE command and don't try to update the source file name, this all works fine. If I include the source file, SQL errors with
>"Bulk load data conversion error (truncation) for row 1, column 10 (Source_File)."
>
>There are multiple lines of the same error, each with varying line numbers.
>
>Anyone know what I'm doing wrong?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform