This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / urgent:I tried to import .csv file into SQL Server database in VB code (SQLDMO)the data format is :
'ID',' username'
'001','name001'
'002','name002'
How can I get ride of single quote?
Thank you for your help!
-nice2002(floater);
2002-7-19
{151}
(#646004@0)
-
replace or trim
-expertune(伪劣砖家);
2002-7-19
(#646037@0)
-
it's bulkcopy,I do not want to import line by line
-nice2002(floater);
2002-7-19
(#646067@0)
-
sorry, not trim, should be LEFT RIGHT or MID. :-)
-expertune(伪劣砖家);
2002-7-19
(#646087@0)
-
应该是不用自己去吧,直接读入就可以吧
-hugefox(长得象熊的狐狸);
2002-7-19
(#646046@0)
-
this is what I want , but how can I set the property to get rid of it?I know if I import manually from SQL Server, I can set the text qualifier to be single quote
-nice2002(floater);
2002-7-19
(#646074@0)
-
mid(fieldnvalue, 2, len(fieldvalue)-2)
-lilyba(Sunshine);
2002-7-19
(#646056@0)
-
那我的就不对了。我原来问过一个倒入数据的oracle的问题。#634487
-lilyba(Sunshine);
2002-7-19
(#646080@0)
-
Here is the code I have, How can I change it get what I want,thanks again
-nice2002(floater);
2002-7-19
{2729}
(#646082@0)
-
May be the only way is to remove single quote from csv file and save as another temp file, use that temp file to do bulk insert.A simple way is to Use "','" as fieldterminator and "'/n" as rowterminator, but this won't remove the first single quote.
-badweather(不识西枫);
2002-7-19
{130}
(#646325@0)
-
objDB.DataFileType=SQLDMODataFile_SpecialDelimitedChar
objDB.ColumnDelimiter ="'"
-maomaoma(毛毛妈);
2002-7-19
(#646631@0)
-
这个好象不大好用,因为如果字符串里有'的话,会被变成''的吧。应该是掐头去尾,替换中间的
-hugefox(长得象熊的狐狸);
2002-7-19
(#646778@0)
-
here is an easy
-bluebluesky(bluebluesky);
2002-7-19
{660}
(#646793@0)
-
GOOD
-nice2002(floater);
2002-7-22
(#650037@0)
-
Thank you for your help, I find the way it may works by using store procedureSET QUOTED_IDENTIFIER OFF
-nice2002(floater);
2002-7-22
{25}
(#649632@0)