SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Bulk Insert vs. Data Flow Task?


Bulk Insert vs. Data Flow Task?

Author
Message
CptCrusty1
CptCrusty1
Say Hey Kid
Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)

Group: General Forum Members
Points: 710 Visits: 387
Yes, I'm kind of a noob with SSIS. We frequently move hundreds of thousands of records from Text files to Raw tables, and ultimatley to production. After I get the Raw data into a Database table, I use a Data Flow Task to push it to a Staging table.

What does Bulk Insert get me? Just throwing it out there to see what comes back.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50667 Visits: 21152
CptCrusty1 (4/23/2013)
Yes, I'm kind of a noob with SSIS. We frequently move hundreds of thousands of records from Text files to Raw tables, and ultimatley to production. After I get the Raw data into a Database table, I use a Data Flow Task to push it to a Staging table.

What does Bulk Insert get me? Just throwing it out there to see what comes back.


Bulk Insert allows you to quickly insert rows into a SQL table from an external source, without resorting to SSIS. I can't see how it would fit well into what you are doing at the moment.

Your data flow sounds odd, by the way.

Text File --> Raw File --> database table --> Staging table

Why would you do this? What happens to data in the staging table?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
CptCrusty1
CptCrusty1
Say Hey Kid
Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)

Group: General Forum Members
Points: 710 Visits: 387
Hey Phil!

Flow is as follows:

Text File --> Raw Table --> Staging Table --> Production Staging Table (Different VM) --> Production Table.


A lot, if not all of the Transformations happen in the Staging Table. As a general rule, I don't think any CRUD/MACD should happen once the data is pushed to the production environment.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50667 Visits: 21152
CptCrusty1 (4/23/2013)
Hey Phil!

Flow is as follows:

Text File --> Raw Table --> Staging Table --> Production Staging Table (Different VM) --> Production Table.


A lot, if not all of the Transformations happen in the Staging Table. As a general rule, I don't think any CRUD/MACD should happen once the data is pushed to the production environment.



I'm sure that you have your reasons, but that looks like one-too-many staging tables to me.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
CptCrusty1
CptCrusty1
Say Hey Kid
Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)Say Hey Kid (710 reputation)

Group: General Forum Members
Points: 710 Visits: 387
Phil,

I would tend to agree with you, the the practice has been in place for a while now. The main reason is that they are using VM instances of SQL Server. All the new data is brought in on Server "A" and is physically seperated from Server "B". Once all the Crunching has taken place on "A's" Staging table. The data is then pushed via Data Flow Task to the Production Server "B". The Staging table there is then compared to the final landing table. Since the possibility exists for duplicates, the tables are compared at a row level and only new stuff gets through. Yes, it's a couple extra steps, but they're conservative with this and it works.

Server "A" is located in house. Server "B" is located off site in a Co-location as part of the Disaster Recovery plan.

Make Sense?

Crusty.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50667 Visits: 21152
I knew that you'd have your reasons - sounds robust and safe to me.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search