How to allow null values in a table

zaurbzaurb Member Posts: 26
Hi!

How can I allow null values in Navision 3.7 tables. I'm writing a VB .NET application which needs to insert some parameters into a table whilst some parameters are not required. I can set "Allow null values" directly on SQL Server, but I wonder how to do that in Navision because I need to export this temp table to fob file.

Thanks!

Zaur
Zaur Bahramov

Comments

  • zaurbzaurb Member Posts: 26
    OK. found it. It was a NotBlank property of the field set to <No>. When I've set it to No it accepted null values.

    A question now is <No> is not supposed to be a default No? I mean wasn't the field supposed to accept null values by default.
    Zaur Bahramov
  • zaurbzaurb Member Posts: 26
    The problem is I still can't insert null from T-SQL since the Allow Nulls in SQL Server table designer is still set to no. I can leave blanks from Navision and it works but, when I insert data through t-sql statement I get the same error:
    Cannot insert the value NULL into column 'Col2', table 'ME_Test.dbo.TestTable$Production Cycle'; column does not allow nulls. INSERT fails.
    Zaur Bahramov
  • DenSterDenSter Member Posts: 8,305
    NAV does not allow null values. Even if you put null values into a column that you force to accept nulls on SQL Server directly, you will get error messages inside NAV when the app tries to ready from that table.

    Null is not the same as blank. You can have blank values in NAV, but it will not accept nulls. Modify your T-SQL script to use blanks instead of nulls and you should be fine.
Sign In or Register to comment.