locked
MySQL Column Values into SQL Table RRS feed

  • Question

  • Hi,

    I am trying to de-code data saved in mysql database through php website. here is sample data. is it possible i can convert this into SQL table to look more presentable.

    I want to take rules and values from this string and constract another t-sql statement

    a:2:
    {s:5:"Lists";a:1:
    {i:0;s:2:"57";}
    s:5:"Rules";a:1:
    {i:0;a:3:
    {s:4:"type";s:5:"group";s:9:"connector";s:3:"and";s:5:"rules";
    a:2:
    {i:0;a:3:
    {s:4:"type";s:4:"rule";s:9:"connector";s:3:"and";s:5:"rules";
    a:3:{s:8:"ruleName";s:2:"63";s:12:"ruleOperator";s:7:"equalto";s:10:"ruleValues";a:1:{i:0;s:10:"SeasonName";}}}
    i:1;a:3:
    {s:4:"type";s:4:"rule";s:9:"connector";s:3:"and";s:5:"rules";
    a:3:{s:8:"ruleName";s:2:"62";s:12:"ruleOperator";s:10:"notequalto";s:10:"ruleValues";a:1:{i:0;s:8:"NameShow";}}
    }
    }
    }
    }
    }

    Monday, October 3, 2016 2:29 PM

All replies

  • Hi Malik,

    This may help you,

    https://jeffprom.com/2015/01/13/cleansing-data-through-ssis-with-dqs/


    Please click Mark As Answer if my post helped.

    Tuesday, October 4, 2016 3:18 AM
  • Thanks Dinesh, but i am looking more through T-SQL.

    Tuesday, October 4, 2016 8:16 AM
  • What's your expected result?
    Monday, October 17, 2016 10:05 AM
  • Hi MalikJaved,

    The sample data are shown in the form of mixed data types or mixed formats. Since SQL Server 2016, you could take a look at STRING_SPLIT (Transact-SQL) and OPENJSON (Transact-SQL).


    Sam Zha
    TechNet Community Support

    Tuesday, October 18, 2016 5:45 AM