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.
Author |
Topic |
dainova
Starting Member
31 Posts |
Posted - 2012-11-15 : 01:32:33
|
Hi, I'm running simple bulk insert and having this problem with setup like belowSET ANSI_NULLS ON GOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOCREATE TABLE [dbo].[Tmsg] ( --ESEventlogMain1]( [msgnumber] [int] NULL, [msgttype] [int] NULL, [mmsg] [varchar] (20) NULL ) ON [PRIMARY] ---------------------------testx.txt11111;2;The status for service 22222;2;Host ADM104 (ADM Group)33333;2;The status for service---------------------------BULK INSERT Tmsg FROM 'C:\Users\memb1\testx.txt' WITH (FIELDTERMINATOR = ';', rowterminator = '\n')--------------------------Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1 (msgnumber).---------------------------select * from tmsgmsgnumber msgttype mmsg----------- ----------- ----------------------------------------22222 2 Host ADM104 (ADM Group)33333 2 The status for service[/code]---What is wrong, I did play with all /n/r, nothing helped, I'm on W and SQLExpress2008 Express.Thanks for you help |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-11-15 : 03:23:02
|
Try with [mmsg] [varchar] (200) NULL instead- LumbagoMy blog-> http://thefirstsql.com |
|
|
dainova
Starting Member
31 Posts |
Posted - 2012-11-15 : 09:22:03
|
Tx, Lumbago. I tried this, same result |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2012-11-15 : 09:42:11
|
What is the code page of the file you are importing? If you don't know you can open it in NotePad++ (a free tool EVERYBODY should use) and it will say the code page in the bottom right corner.- LumbagoMy blog-> http://thefirstsql.com |
|
|
|
|
|
|
|