Notice - insert with not nullable nvarchar(max)

Thread is closed for posting
2 posts, 1 answers
  1. Exi
    Exi avatar
    8 posts
    Member since:
    May 2008

    Posted 24 Jun 2009 Link to this post


    i have a class which contains reference on nvarchar(max) column, which is not nullable and have it's default value ''. When i create new instance of the class and initializing this field to empty string, after adding it to scope sql server (2008) throws an exception:

    SqlCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size. 

    I tried to chenge definitions in App.config setting size of this column to great value or zero and playing with it's db types, but with no results.

    I think, that this is not really an error, because setting column definition to null and excluding initializing of this nvarchar(max) field solves the problem.

    Have a nice time

  2. Answer
    Alexander avatar
    727 posts

    Posted 26 Jun 2009 Link to this post

    Hi Exi,

    Indeed this was a problem, but recently we made a few fixes in the empty string handling mechanism. You can upgrade to the latest internal build (2009.01.0605.1) or wait for the official 2009 Q2 release which is coming in maximum two weeks. The fix allows you to initialize and store the empty string value properly.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top