Home Forums SQL Server 2005 SQL Server Newbies Generate two columns from single column with alternating data RE: Generate two columns from single column with alternating data

  • Thanks -- I always love robust code.

    In this case, it's a (relatively) small data set, and the pattern never deviates.

    (TMI)

    The table is populated from the output of a powershell script that checks the password expiration date of SQL Server service accounts. So, the source data initially looks like this:

    [font="Courier New"]...

    cn : MSSQL_INSTANCE01_SVC

    ...

    PasswordExpires : 3/20/2014 1:09:02 PM

    ...[/font]

    ... my apologies, I'm losing some formatting here even though I changed to a mono-spaced font.

    Next, I strip out the "cn:" and "PasswordExpires:" and am left with just the alternating data.

    🙂