Options to copy a SharePoint list to a SQL Server database table without using SSIS
Hi, What are my options to copy a SharePoint 2007 list data into a SQL Server table on a nightly basis job? I know that I can use SSIS, but I wonder if there is any simpler way of doing it. Thank you,
May 11th, 2012 11:05am

Hi, There is one option, hope you find it easy. 1. create stored procedure in SQL database to insert the data into the required table. 2. store the connection string in the web.config of the site. 3. In your nightly job - call that stored procedure and insert the data from SharePoint list items in it. Regards, Sachwani
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2012 8:35pm

Hi Sachwani, How do I get data from the sharepoint list?
May 11th, 2012 8:43pm

Hi, The easiest way that you can create SharePoint list item event handler and on "ItemAdded" event you fetch all the list item column values by SharePoint object model. After that call stored procedure and pass those values as parameters to that. If you are planning for one night job every day than you need to do check to check which items are already copied to database, so that only new items will gets copied in that instance of job. Regards, Sachwani
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2012 9:22pm

Hi Allan49, You can use SqlBulkCopy class to copy that data from SPList to SQL server database. Please have a brief look at the following article (SharePoint Lists Data into SQL Server Tables using SqlBulkCopy). The specification made on this article exactly matches to your requirements. Hope this helps. Best Regards, Devang Bhavsar
May 12th, 2012 4:33am

Hi, You can create two kinds of jobs here either timer job or scheduled job. In both the cases I would suggest you to store the connection string in web.Config file instead of directly hard coding it in the job code. Now in the code itself connect to the SQL server and then table and insert data from your list to table. I hope this will help you out.Thanks, Rahul Rashu
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2012 10:39pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics