-5

enter image description herei was using uniqueidentifier colunm in my db and default value was newid() i cahnge it to NEWSEQUENTIALID() how could i change the start value of it to increasse the last one

  • show some sample data and what does it mean by change initial value ? – TheGameiswar Oct 13 '16 at 14:00
  • 2
    What does this even mean? And why in the world do you care? If you are using newsequentialid the actual value should not matter at all. – Sean Lange Oct 13 '16 at 14:00
  • i was using uniqueidentifier colunm in my db and default value was newid() i cahnge it to NEWSEQUENTIALID() how could i change the start value of it to increasse the last one – Ahmed Ramadan Oct 13 '16 at 14:03
  • Well that clarified things. – Dave C Oct 13 '16 at 14:08
  • Why do you need to change it? What could you possibly gain from that? – Sean Lange Oct 13 '16 at 14:11
  • i work with two db(same db and same web application , user asked me to make it offline and online cuse network sometimes damage ) one is online other is offline and for some reasons i can't use replication in sqlserver so i use text file and write the procedure which done by programe and then run it in other side to get the data which created – Ahmed Ramadan Oct 13 '16 at 14:15

1 Answers1

0

You cannot set initial value for newsequentialid(), See below example

create table t3 (id uniqueidentifier default newsequentialid(), idnum int)

insert into t3(id,idnum) values (newid(),10)
insert into t3(idnum) values (11),(12)

select * from t3

Even if you set different uniqueidentifier it will not continue from that.

Kannan Kandasamy
  • 13,405
  • 3
  • 25
  • 38
  • so i cannot set initial value for newsequentialid() thanks – Ahmed Ramadan Oct 13 '16 at 14:17
  • Yes, but still not able to find msdn link for the same... You can refer further on this https://social.msdn.microsoft.com/Forums/sqlserver/en-US/cad8a4d7-714f-44a2-adb0-569655ac66e6/newsequentialid?forum=sqltools – Kannan Kandasamy Oct 13 '16 at 14:24