• pawan.boyina (8/18/2012)


    If we take a subset of dates then the same is working

    If we need all the dates of a Year to be taken in that query, is it possible as print @query is not giving me the result, how to handle such situations.

    As Chris pointed out,

    A message string can be up to 8,000 characters long if it is a non-Unicode string, and 4,000 characters long if it is a Unicode string. Longer strings are truncated. The varchar(max) and nvarchar(max) data types are truncated to data types that are no larger than varchar(8000) and nvarchar(4000).

    So, the string you see when PRINTing does not reall matter.

    Try to do this:

    print substring(@query, LEN(@query) - 100, 120)

    This should confirm that your @query has all the characters.

    What is the error message returning by the EXECUTE statement?

    _____________
    Code for TallyGenerator