Contenu connexe Similaire à Share point techfest 2011 user driven data sources (20) Plus de Marc Hoppers (13) Share point techfest 2011 user driven data sources12. Show how the steps in SQL Server allow you to leverage the data 13. Show how to repopulate a SharePoint list from SQL Server 14. How to use PowerShell to interact with SharePointData Infrastructure & BI Platform SQL Server SharePoint List 15. Why you should care Respond to outside market/industry forces The IT department doesn’t have foresight into the market and how outside forces can affect a critical business function. Lynch pin problem More often then not there is one person who manages a certain business process or knowledge base that if they were gone tomorrow would cause problems with how the department operates. 4 © 2011 Cogent Company. Proprietary and Confidential. 16. 5 © 2011 Cogent Company. Proprietary and Confidential. Healthcare Industry Month End close is dependent on accurate medical rates for revenue estimation and reporting Medical rates driven by outside forces (Government/Industry) Finance manager responsible for keeping accurate rates The problem Month end reporting is dependent on monthly medical rates for accurate calculation One person manages the data Our Business Scenario 17. 6 © 2011 Cogent Company. Proprietary and Confidential. Solution Architecture (Lynch Pin issue) – SharePoint List BIDS SSIS Solution SharePoint Connector Execute SQL commands (Data Management issue) - SQL Server Temp tables and merge function PowerShell Script Truncate list Status Indicator 18. 7 © 2011 Cogent Company. Proprietary and Confidential. SharePoint List Primary Key Title Field 19. 8 © 2011 Cogent Company. Proprietary and Confidential. BIDS Solution SharePoint Connector CodePlex - SharePoint List Source and Destination http://sqlsrvintegrationsrv.codeplex.com/releases/view/17652 20. 9 © 2011 Cogent Company. Proprietary and Confidential. SQL Server 2008 Nothing out of the ordinary if you’re familiar with the Merge Function Merge Function Staging table and History Table Easy to handle slowly changing data Inbound and outbound temp tables But Incase you aren’t familiar with it MERGE Demo D USING Temp T ON D.ID = T.ID and D.Name = T.Name WHEN MATCHED THEN UPDATE SET D.Rate = T.Rate WHEN NOT MATCHED BY TARGET THEN INSERT (Rate) VALUES T.Rate OUTPUT $action INTO @RateChanges; 21. 10 © 2011 Cogent Company. Proprietary and Confidential. Truncate Table Firm understanding of list location PowerShell Script [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) | out-null $oContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService; [Microsoft.SharePoint.Administration.SPWebApplicationCollection]$waColl = $oContentService.WebApplications; $siteUrl = “http://win-bidemo” $webName = “” $listName = "Demo List" $spSite = new-object Microsoft.SharePoint.SPSite($siteurl) $spWeb = $spSite.OpenWeb($webName) $spList = $spWeb.Lists[$listName] foreach($item in $spList.items) { $deaditem = $splist.GetItemById($item.ID); $deaditem.Delete(); } 22. DEMO 11 © 2011 Cogent Company. Proprietary and Confidential. 23. 12 © 2011 Cogent Company. Proprietary and Confidential. Additional Functionality SharePoint list trigger for real time updates and “What if” scenarios Surface data in SSAS Cube Slowly changing data Auditing Status Indicator 24. Gotchas Keep the Title You can’t delete the title on a content type so just hide it and make it not required Primary Key Remember databases work from keys, so a primary key is needed in your SharePoint List for data integrity between SharePoint and SQL Server SharePoint Connector Must truncate SharePoint list before you can write back to them From SharePoint to SQL Server Use Ntext as SQL Server data type instead of varchar from SharePoint to SQL Server destination tables From SQL Server to SharePoint list Float instead of decimal for moving SQL Server data to SharePoint list nvarchar instead of Int for moving SQL Server data to SharePoint list PowerShell Take note if SSIS is executing in a 64bit machine and not 86bit PowerShell executable file is different. 13 © 2011 Cogent Company. Proprietary and Confidential. 25. 14 © 2011 Cogent Company. Proprietary and Confidential. Conclusion Quick to implement solution for user driven data that needs to be leveraged for Data Warehouse. Structure and Unstructured Data Easy to leverage slowly changing data Take the responsibility out of the IT department Take away the lynch pin of a business process and move it away from sole ownership 26. Reference Links SharePoint list Source and Destination Connector http://sqlsrvintegrationsrv.codeplex.com/releases/view/17652 PowerShell http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/216d2ee6-0f04-480f-808d-8241bc4a8d18/ http://stackoverflow.com/questions/3913498/sharepoint-script-fails-when-run-as-a-visual-studio-post-deployment-command 15 © 2011 Cogent Company. Proprietary and Confidential. 27. Q&A 16 © 2011 Cogent Company. Proprietary and Confidential. 28. 17 © 2011 Cogent Company. Proprietary and Confidential. Andrew Alexander Andrew.Alexander@CogentCompany.com