Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: sp_ww_newid question

$
0
0
Re: sp_ww_newid question
SQL Programming
Re: sp_ww_newid question
Mar. 13, 2013
12:17 pm
3QJ0QC0BDShow this entire thread in new window
Gratar Image based on email address
From:Matt Slay
To:Alex Sosa
I've noticed that the CreateNewId() method, when working with FoxPro DBF tables, will add the tablename to the ww_id table if it is not already present, but in Sql Server mode, it does not add the table name to wws_id. I'm moving my app from DBFs to Sql Server, and it looks like you've just got to manually prep the wws_id table with each table name and the correct next ID value to use.


Don't know where this question belongs.

With datamode = 0, wwBusiness.CreateNewId generates the next id and checks if it is already used. If the id goes over 2 ^ 32, it wraps around to 0.

With datamode = 2 (SQL server), I see a call is made to sp_ww_newid, but that stored procedure doesn't do anything similar. Am I missing something?

How do you figure. It does the same thing except the rollover. I think if you are worried about rollover on 2 billion you can easily reset the counter at some point before it hits 2 billion and let it fill in the blanks.

+++ Rick ---

Thanks for the response. You are correct especially with the posibility of 64 bit integers. I was more wondering how to modify the procedure so that it automatically creates a record in the id table if there isn' t one already.

Later... Working on it... I'm new to stored procedures. Thanks for the model.


Viewing all articles
Browse latest Browse all 10393

Trending Articles