• davdam8 (10/24/2012)


    Thanks

    It gives me an error: Argument data type ntext is invalid for argument 1 of len function

    Solutions?

    Regards

    That would be because you didn't supply DDL or readily consumable sample data, which caused me to assume that you were not using a deprecated type.

    You'll have to cast it to NVARCHAR or VARCHAR to use, e.g.

    SELECT *

    FROM #yourTable

    WHERE LEN(CAST(yourData AS NVARCHAR(MAX)))-1 = LEN(REPLACE(CAST(yourData AS NVARCHAR(MAX)) COLLATE Latin1_General_BIN2,'.',''));


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/