Null not allowed in textfileds on sql server

roynesroynes Member Posts: 23
edited 2009-03-26 in SQL General
I have created a table in NAV, an external application is filling data into this SQL table.
but the external apllication have problem when inserting records with "Null" values in one of the fields.
Does anyone know how to change the field propperty, so the field accept Null values?

/roynes

Comments

  • garakgarak Member Posts: 3,263
    Sorry, but NULL is not allowed in tables that are used by NAV. So set the NAV default values.

    BLANK for VarChar
    1754-01-01 00:00:00.000 for DAte and time
    False for Bool

    and so on ........
    Do you make it right, it works too!
  • roynesroynes Member Posts: 23
    I think i have tried to set default value on the fields property, without succsess. I guessed that the default value set in navision only would be used when filling data from C/C-Side, and not when using an sql/odbc "Insert Into" ., but i wil try it again.

    Thanks /roynes
  • BeliasBelias Member Posts: 2,998
    roynes wrote:
    I think i have tried to set default value on the fields property, without succsess. I guessed that the default value set in navision only would be used when filling data from C/C-Side, and not when using an sql/odbc "Insert Into" ., but i wil try it again.

    Thanks /roynes
    you're right, you have to change the way your external program fills sql. Be aware of lowercase characters in code fields, too! ;)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • jlandeenjlandeen Member Posts: 524
    As already pointed out you do have to be careful with code fields and date fields when you're working with data in SQL that is to be read by NAV.

    When integrating with other systems this way I normally make most of the fields text (i.e. varchar) and then clean up and evaluate the data in a codeunit, report or other process in NAV. Then even if the other system doesn't upper case code fields or setup other values correctly you a trigger point in NAV where you can do that kind of simple clean up work.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • garakgarak Member Posts: 3,263
    roynes wrote:
    I think i have tried to set default value on the fields property, without succsess. I guessed that the default value set in navision only would be used when filling data from C/C-Side, and not when using an sql/odbc "Insert Into" ., but i wil try it again.

    Thanks /roynes

    I mean with set the NAV default values the following: You must set it, as Belias saied, with your externel application that creates this records.
    Do you make it right, it works too!
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV/Navision' forum to 'SQL General' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • davmac1davmac1 Member Posts: 1,283
    On alter database - integration tab, there is a maintain defaults checkbox.
    IF you check this, then NAV will set the default settings for every column in every table in SQL Server.
    If an outsider does a SQL insert that does not insert all the columns in a table, SQL Server will then fill in the default values.

    This works very well as long as a SQL only person does not start messing with the constraints and mess up the standard naming convention NAV uses.
Sign In or Register to comment.