• Similar to Luis's suggestion:

    WITH Dummy(ID, String) AS(

    SELECT 1,'SubnetAddress=10.16.224.128' UNION ALL

    SELECT 2,'SubnetName=FOS-Salzburg Kasernenstraase #823 VPN' UNION ALL

    SELECT 3,'SubnetMask=255.255.255.128' UNION ALL

    SELECT 4,'NetworkAddress=10.0.0.0' UNION ALL

    SELECT 5,'LocationID=895' UNION ALL

    SELECT 30,'SubnetDescription=CHINA-BEIJING-C025 F2 XIANGJIANG CNVASX1706' UNION ALL

    SELECT 31,'DHCPOptionTemplate=' UNION ALL

    SELECT 32,'DHCPPolicyTemplate=' UNION ALL

    SELECT 33,'PrimaryInterface=No' UNION ALL

    SELECT 34,'AllowDHCPClientsModifyDynamicObjectResourceRecords=Same As in Global Policies'

    )

    SELECT SubnetMask=MAX(CASE WHEN 'SubnetMask' THEN [value] END)

    ,SubnetDescription=MAX(CASE WHEN 'SubnetDescription' THEN [value] END)

    FROM Dummy a

    CROSS APPLY (

    SELECT =LEFT(String, CHARINDEX('=', String)-1)

    ,[value]=RIGHT(String, LEN(String)-CHARINDEX('=', String))) b


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St