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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sales orders into sql database

Author  Topic 

nevzab
Starting Member

34 Posts

Posted - 2013-07-31 : 17:07:42
Not sure if I should be posting such a general, and maybe rather vague, question but thought it would be worth a go. I have just started a new job and have been asked to liaise with a company that design websites and provide e-commerce solutions with a view to working out a solution for getting sales orders placed through the website into our own SQL database. I would appreciate any advice anyone can offer regarding how to get the data (sales orders) into the database. All I have been told is that we have access to some middleware that can extract the data in XML or CSV format. Would this normally be done using bulk inserts or are there other more sophisticated methods? Thanks

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-07-31 : 17:27:31
Depending on the format and how stable the format is you could use a component that will parse/shred the files (which is what I thinkt he "middleware" you mentioned). You could possibly use BCP or SSIS to ingest them too. There are lots of ways to skin that cat.
Go to Top of Page

nevzab
Starting Member

34 Posts

Posted - 2013-07-31 : 17:45:00
Can BCP be built into a stored procedure? I am hoping the middleware will call an the SP which then performs the bulk copy. Does this sound plausible?
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-07-31 : 18:19:40
You can build BULK INSERT into a stored procedure. If you go that route, you would need to save the data as a csv file to some location and run a stored procedure that has the bulk insert command in it with the appropriate parameters: http://msdn.microsoft.com/en-us/library/ms188365.aspx

Another option would be to send the data as XML to the stored procedure, shred it in the stored procedure and store it. If you do that, you would not need to save the data as a file. However, for large data sets (tens of thousands of rows), shredding XML is likely to be slow.
Go to Top of Page

nevzab
Starting Member

34 Posts

Posted - 2013-08-02 : 16:13:24
Thanks guys. I will consider both options.
Go to Top of Page
   

- Advertisement -