Home Forums SQL Server 2014 Administration - SQL Server 2014 Problem Converting DATE. Trying to Purge Data Oldest than 30 days from Performance Counter Table where date column is char (24) RE: Problem Converting DATE. Trying to Purge Data Oldest than 30 days from Performance Counter Table where date column is char (24)

  • John Mitchell-245523 - Friday, August 10, 2018 2:21 AM

    dfd.francisco 53179 - Friday, August 10, 2018 2:05 AM

    Hi try a workarround, deleting and recreating the table with the column in DATETIME, but then the performance counter BLOWS :pinch:

    What do you mean by that?  If you have the option to redesign the table then that's what you should do.  Store dates as dates.  Even if performance is worse, it's still working as it should.  If you can't change the table, then try taking the hyphens out of the stored dates.  I couldn't replicate that myself, but I think I've heard reports that sometimes the hyphen stops the date from being convertible.

    SELECT CAST('2018-08-10 09:16:57.803' AS datetime)
    SELECT CAST('20180810 09:16:57.803' AS datetime)

    John

    I John

    I cannot redesign the table with the column with the right format (DATETIME) because it´s a default table for Perfomon. I have tryed and recreated the table but when i start the performance monitor counters , the process blows up. 

    I am out of ideas, I only want to purge data oldest than 10 days, ARGHHHH :pinch: