'SQL Pivot table?

Hi I am looking for a SQL Script the can pivot the following table enter image description here

Every values in ObjectClassProperty column must become columns. ObjectInstanceProperty will become values for the respectivly newly created column.

One thing to keep in mind. ObjectClass is dynamically changing.

sql


Solution 1:[1]

I have implemented once such similar solution in MS SQL Server 2019 version. Details can be found in the dbfiddle<>example<>dynamicpivot.

Note: This will work if there are not duplicates in ObjectClassProperty.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Srishuk Kumar Bhagwat