I am taking a DB management class but i would really like to play with it at home so am trying to copy the db's to my computer so i did a simple select * from collect and saved the results as a csv so i have all the records
at home i made the db
CODE
create table collection
(
BOOK_ID CHAR(5) NOT NULL,
SCAN_CODE CHAR(6) NOT NULL,
LIBRARY CHAR(8) NOT NULL,
BOOK_STATUS CHAR(1) NOT NULL,
DATE_LAST_OUT DATETIME NOT NULL,
TIMES_CHECKED_OUT NUMERIC(4) NOT NULL,
CHECK_OUT_INTERVAL CHAR(1) NOT NULL,
COST NUMERIC(7,2) NULL,
YEAR_ACQUIRED CHAR(4) NULL,
LAST_DATE_UPDATED DATETIME NOT NULL
)
then tried to insert the data but then i get errors and have no idea what i need to do
CODE
BULK INSERT collection FROM 'C:\DB\collection.csv' WITH (FIELDTERMINATOR = ',')
Errors
QUOTE
Msg 4863, Level 16, State 1, Line 1
Bulk load data conversion error (truncation) for row 1, column 1 (BOOK_ID).
Msg 4866, Level 16, State 8, Line 1
The bulk load failed. The column is too long in the data file for row 1, column 10. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)"
Sample of data
QUOTE
00220,A63982,JCLS,R,1999-07-20 00:00:00.000,5,C,12.59,1981,1990-09-04 00:00:00.000
00807,A64129,JCLS,I,1999-08-02 00:00:00.000,6,C,NULL,1973,1990-10-22 00:00:00.000
00206,A65257,JCLS,I,1999-07-12 00:00:00.000,1,C,NULL,1980,1991-01-30 00:00:00.000
00931,A65258,JCLS,I,1999-12-22 00:00:00.000,9,B,8.95,1975,1990-03-07 00:00:00.000
00669,A65382,JCLS,O,1999-12-19 00:00:00.000,3,C,7.95,1971,1990-09-01 00:00:00.000
Thanks
This post has been edited by realNoName: 9 Feb, 2007 - 12:30 PM