Click here to Skip to main content
15,885,686 members
Home / Discussions / Database
   

Database

 
QuestionBULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 22:29
T210230-Mar-10 22:29 
AnswerRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
Mycroft Holmes30-Mar-10 22:47
professionalMycroft Holmes30-Mar-10 22:47 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 23:22
T210230-Mar-10 23:22 
AnswerRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov30-Mar-10 23:11
R. Giskard Reventlov30-Mar-10 23:11 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 23:28
T210230-Mar-10 23:28 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
Mycroft Holmes31-Mar-10 1:27
professionalMycroft Holmes31-Mar-10 1:27 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov31-Mar-10 5:09
R. Giskard Reventlov31-Mar-10 5:09 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T21021-Apr-10 3:25
T21021-Apr-10 3:25 
Given the double quote issue in the data set, I cannot use the ADO .NET csv file reading capability directly. Instead I tried using ReadAllText and WriteAllText to remove the single quotes and double quotes.

I keep getting an out of memory error after a few minutes of inserts. I was able to load the datasets (before discovering the double quote issue)without any memory issues. I have 4 GB of physical memory and a maximum 16 GB virtual memory setting on my laptop. My aggregate datasets should take no more than 6GB of space in SQL Server. I've tried rebooting a couple of times and that did not help. Any ideas?


void Cleanse_File(System::String ^Full_Path_To_File,
long & ErrorCode) {
try {
System::String ^text = System::IO::File::ReadAllText(Full_Path_To_File);
text = text->Replace("'", "");
text = text->Replace("\"", "");
System::IO::File::WriteAllText(Full_Path_To_File, text);
}
catch(System::Exception ^e) {
System::Console::WriteLine(e->Message);
}
}

At this point, I am thinking of using a different csv file reader and hoping that it can handle the double quotes without mismapping columns.
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov1-Apr-10 4:04
R. Giskard Reventlov1-Apr-10 4:04 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings [modified] Pin
T210231-Mar-10 19:07
T210231-Mar-10 19:07 
QuestionDeducting data vs saving it explicitly Pin
Alivemau530-Mar-10 11:11
Alivemau530-Mar-10 11:11 
AnswerRe: Deducting data vs saving it explicitly Pin
PIEBALDconsult30-Mar-10 12:13
mvePIEBALDconsult30-Mar-10 12:13 
AnswerRe: Deducting data vs saving it explicitly Pin
Garth J Lancaster30-Mar-10 15:51
professionalGarth J Lancaster30-Mar-10 15:51 
AnswerRe: Deducting data vs saving it explicitly Pin
PIEBALDconsult30-Mar-10 17:48
mvePIEBALDconsult30-Mar-10 17:48 
AnswerRe: Deducting data vs saving it explicitly Pin
Eddy Vluggen31-Mar-10 0:36
professionalEddy Vluggen31-Mar-10 0:36 
Questionlogin Pin
farokhian30-Mar-10 9:44
farokhian30-Mar-10 9:44 
AnswerRe: login Pin
netJP12L30-Mar-10 10:13
netJP12L30-Mar-10 10:13 
GeneralRe: login Pin
farokhian30-Mar-10 10:42
farokhian30-Mar-10 10:42 
AnswerRe: login Pin
Don Burton30-Mar-10 10:21
Don Burton30-Mar-10 10:21 
Questiontable join Pin
netJP12L30-Mar-10 8:15
netJP12L30-Mar-10 8:15 
AnswerRe: table join Pin
Mycroft Holmes30-Mar-10 22:56
professionalMycroft Holmes30-Mar-10 22:56 
QuestionHelp with T-SQL Statement?? Pin
ostinoh30-Mar-10 5:02
ostinoh30-Mar-10 5:02 
AnswerRe: Help with T-SQL Statement?? Pin
Don Burton30-Mar-10 10:23
Don Burton30-Mar-10 10:23 
GeneralRe: Help with T-SQL Statement?? Pin
ostinoh30-Mar-10 15:21
ostinoh30-Mar-10 15:21 
AnswerRe: Help with T-SQL Statement?? Pin
Mycroft Holmes30-Mar-10 23:03
professionalMycroft Holmes30-Mar-10 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.