Click here to Skip to main content
15,905,679 members
Home / Discussions / Database
   

Database

 
AnswerRe: Importing of Huge fixed width text file in sql server table Pin
PIEBALDconsult27-Dec-12 14:08
mvePIEBALDconsult27-Dec-12 14:08 
AnswerRe: Importing of Huge fixed width text file in sql server table Pin
Deepak Kr130-Dec-12 20:29
Deepak Kr130-Dec-12 20:29 
AnswerRe: Importing of Huge fixed width text file in sql server table Pin
jschell31-Dec-12 9:14
jschell31-Dec-12 9:14 
Questionshow Sum(Balance) as ob on Rows Header and add next rows balance in ob Pin
hadeed147227-Dec-12 6:52
hadeed147227-Dec-12 6:52 
AnswerRe: show Sum(Balance) as ob on Rows Header and add next rows balance in ob Pin
Corporal Agarn27-Dec-12 7:53
professionalCorporal Agarn27-Dec-12 7:53 
GeneralRe: show Sum(Balance) as ob on Rows Header and add next rows balance in ob Pin
hadeed147227-Dec-12 8:03
hadeed147227-Dec-12 8:03 
QuestionSQL BulkCopy using IDataReader - how can you cast the fields? Pin
Allan Watkins26-Dec-12 19:12
Allan Watkins26-Dec-12 19:12 
AnswerRe: SQL BulkCopy using IDataReader - how can you cast the fields? Pin
Mycroft Holmes26-Dec-12 20:32
professionalMycroft Holmes26-Dec-12 20:32 
Well I would say you are screwed, only because you are trying to transform the data in your load. IMHO transforms are the biggest time waster ever inflicted on the load process. I would split the operations to a load process and then a transform. Caveat I am not addressing the size issue as I have never had the problem (and 500mb is very small beer in our environment).

I would do the following.
Read in the data file and get the header record.
Create a staging table in sql server exactly matching the column headers - every column to be varchar or nvarchar if needed
Convert the csv file to a datatable (This article [^]may help).
Use BulkCopy to load the data (everything is varchar so it WILL load)
Use a stored proc to do the transforms from the staging table to the target table. If you have to use a dictionary file then you are going to have to take that into account and it will be a challenge (probably a crap load of dynamic sql).
Drop the staging table
Never underestimate the power of human stupidity
RAH

GeneralRe: SQL BulkCopy using IDataReader - how can you cast the fields? Pin
AllanW1111127-Dec-12 6:02
AllanW1111127-Dec-12 6:02 
AnswerRe: SQL BulkCopy using IDataReader - how can you cast the fields? Pin
PIEBALDconsult27-Dec-12 8:48
mvePIEBALDconsult27-Dec-12 8:48 
QuestionSubquery returns more than 1 row Pin
Jassim Rahma24-Dec-12 1:02
Jassim Rahma24-Dec-12 1:02 
AnswerRe: Subquery returns more than 1 row Pin
Eddy Vluggen24-Dec-12 1:29
professionalEddy Vluggen24-Dec-12 1:29 
AnswerRe: Subquery returns more than 1 row Pin
MaulikDusara24-Dec-12 21:44
MaulikDusara24-Dec-12 21:44 
GeneralRe: Subquery returns more than 1 row Pin
Eddy Vluggen25-Dec-12 2:41
professionalEddy Vluggen25-Dec-12 2:41 
GeneralRe: Subquery returns more than 1 row Pin
Mycroft Holmes26-Dec-12 11:17
professionalMycroft Holmes26-Dec-12 11:17 
GeneralRe: Subquery returns more than 1 row Pin
MaulikDusara26-Dec-12 18:45
MaulikDusara26-Dec-12 18:45 
GeneralRe: Subquery returns more than 1 row Pin
Eddy Vluggen27-Dec-12 4:24
professionalEddy Vluggen27-Dec-12 4:24 
QuestionOn the Naming of Columns for Lookup tables. Pin
Brady Kelly17-Dec-12 22:44
Brady Kelly17-Dec-12 22:44 
AnswerRe: On the Naming of Columns for Lookup tables. Pin
Mycroft Holmes17-Dec-12 23:19
professionalMycroft Holmes17-Dec-12 23:19 
GeneralRe: On the Naming of Columns for Lookup tables. Pin
Brady Kelly17-Dec-12 23:26
Brady Kelly17-Dec-12 23:26 
GeneralRe: On the Naming of Columns for Lookup tables. Pin
Mycroft Holmes18-Dec-12 1:11
professionalMycroft Holmes18-Dec-12 1:11 
GeneralRe: On the Naming of Columns for Lookup tables. Pin
Brady Kelly18-Dec-12 1:15
Brady Kelly18-Dec-12 1:15 
AnswerRe: On the Naming of Columns for Lookup tables. Pin
PIEBALDconsult18-Dec-12 4:05
mvePIEBALDconsult18-Dec-12 4:05 
GeneralRe: On the Naming of Columns for Lookup tables. Pin
Brady Kelly18-Dec-12 4:12
Brady Kelly18-Dec-12 4:12 
GeneralRe: On the Naming of Columns for Lookup tables. Pin
PIEBALDconsult18-Dec-12 4:46
mvePIEBALDconsult18-Dec-12 4:46 

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.