Partitioned view on tables with text field

  • Is it possible to create a partitioned view on a table that has a text field in it (obviously not as a partitioning field)? I tried but I get the following error:

    "The text, ntext, or image data type cannot be selected as DISTINCT."

    I didn't see anything in the BOL about a restriction on tables with text fields.

  • Yes, it is possible. I have such a partitioned view with a text field in production with no problems.

    Assuming that you did not explictly indicate DISTINCT in the sql defining the view, I'm guessing that your view uses UNIONs instead of UNION ALL.  UNIONs always imply a implicit distinct because they remove duplicates.  Make sure you are using UNION ALL to combine the independent select statements in the view.

    If you are already using UNION ALL, could you post the create statement for your view, along with the relevant datatypes for each returned column?

     

    Scott Thornburg

    Volt Information Sciences

     

     

  • You guessed it, I forgot to make it a UNION ALL.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply