sql guid's

  • i have code that has been working for years which inserts GUID's for each record as and when saved.

    As of yesterday when i check the GUID's being saved are all 00000000-0000-0000-0000-000000000000 ?

    What could suddenly change for this to happen?

    I am using Guid.NewGuid() to generate the GUID in code

  • Dave Rooke - Wednesday, May 3, 2017 2:53 AM

    i have code that has been working for years which inserts GUID's for each record as and when saved.

    As of yesterday when i check the GUID's being saved are all 00000000-0000-0000-0000-000000000000 ?

    What could suddenly change for this to happen?

    I am using Guid.NewGuid() to generate the GUID in code

    Did you check the SQL Server error logs? Did you run a trace while inserting the GUID? Did you debug your code to see what is being generated?
    I highly doubt that is a SQL Server issue - most likely it's based on something in your code, application or something along those lines.

    Sue

  • Dave Rooke - Wednesday, May 3, 2017 2:53 AM

    i have code that has been working for years which inserts GUID's for each record as and when saved.

    As of yesterday when i check the GUID's being saved are all 00000000-0000-0000-0000-000000000000 ?

    What could suddenly change for this to happen?

    I am using Guid.NewGuid() to generate the GUID in code

    You will need to debug your .net code - are you sure you are calling Guid.NewGuid() in all places?
    Guid g = new Guid(); //will always return all zeros like you have
    Guid g1 = Guid.NewGuid(); //will always return a new non zero guid

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

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