In this demo, we will show how you can explode a Bill of Materials using Graph Shortest Path function, introduced with SQL Server 2019 CTP3.1, to find out which BOMs/assemblies a given product/part belongs to. This information can be useful for reporting or product recall scenarios. We will explore the Shortest Path function and try to understand different ways in which it can be used.
More information:
- SQL Server Graph official documentation: https://docs.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-overview, https://docs.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-architecture and https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/20/graph-data-processing-with-sql-server-2017/
- Bulk Insert Best Practices: https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/sql-graph
- Recommendation System: https://blogs.msdn.microsoft.com/sqlcat/2017/04/21/build-a-recommendation-system-with-the-support-for-graph-data-in-sql-server-2017-and-azure-sql-db/
- Product Recommendations in WideWorldImporters using SQL Graph: https://github.com/Microsoft/sql-server-samples/tree/master/samples/demos/sql-graph/recommendation-system
- Edge Constraints: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2018/09/28/public-preview-of-graph-edge-constraints-on-sql-server-2019/
- Using Derived Tables or Views in graph match: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2018/11/07/public-preview-of-derived-tables-and-views-on-graph-tables-in-match-queries/, https://github.com/microsoft/sql-server-samples/tree/master/samples/features/sql-graph/DerivedTablesAndViewsInGraphMatch
- SHORTEST_PATH function: https://techcommunity.microsoft.com/t5/SQL-Server/Public-Preview-of-Shortest-Path-on-SQL-Server-2019/ba-p/721240, https://github.com/microsoft/sql-server-samples/tree/master/samples/features/sql-graph/ShortestPath
- Advanced Graph Algorithms: https://github.com/shkale-msft/GraphRecursiveQueries
Follow Shreya Verma and Jeroen ter Heerdt on Twitter at https://twitter.com/ShreyaVermaKale and https://twitter.com/jeroenterheerdt.
Updated Sep 19, 2019
Version 2.0dutchdatadude
Microsoft
Joined January 30, 2019
Azure SQL Blog
Follow this blog board to get notified when there's new activity