• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

NEWSEQUENTIALID() Function used in sql server table

I have created a table that has a Primary Key column with a Default  value of
newsequentialid() specified.
However, every time I insert into the table, the newsequentialid() function keeps generating the same value
0000 0000-0000-0000-0000-000000000000 . Thus failing to insert more than one row.
How do I get the newsequentialid() to create a new unique value?
1 Solution
Brian CroweDatabase AdministratorCommented:
Please post your table creation script.
Surendra NathTechnology LeadCommented:
looks like you have to create the data type as uniqueindentifier for this to work or else you might get some garbage...

check the below link
metro156Author Commented:
See attached script. See the ID column how it is created in the Countries table
This file contains the script.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now