Announcement

Collapse
No announcement yet.

uniqueidentifier fields on a MS SQL table

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • uniqueidentifier fields on a MS SQL table

    I have a table in a MS SQL db that has among others, three columns of type "uniqueidentifier".

    One column is marked as the primary key and has a default value set of "newid()".

    When I try to create a new record for this table from a SC form - the primary key is generated as expected, however, the other two columns are also being created with "newid" values. This is not correct as I am passing the values for those columns into the form app and am expecting the form to use my own values and not self-generated values.

    I have even tried to set the default values for the two fields on their settings and code-behind with global variables, but this does not work.

    How do I prevent a form from using "newid()" values for fields of type "uniqueidentifier"?

    thank you

  • #2
    Check in edit fields if this fields has "insert in db" to automatic
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      no, I have turned "insert in db" off on those fields but the uniqueidentifier is still being generated

      Comment


      • #4
        Originally posted by Steph View Post
        no, I have turned "insert in db" off on those fields but the uniqueidentifier is still being generated
        I tried and works as expected (MySQL).

        What throws generation at database level is the option of DB Value (always, or calculated if null, for example):
        Captura2.PNG

        In yellow, are the options thath means DB is responsible of generate a value. If you don't want to DB generate value, you must to have it as red, and always value is generated only if table is ready for this. I'm not an expert on SQL Server, but is the normal behaviour in all databases.

        Obviously, if you know this, maybe there are some kind of bug with SQL Server driver.
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment

        Working...
        X