October 7, 2004 at 8:10 am
This design limits the number of possible values to:
If you are happy with that then why not prepopulate the table. Issues are only 2n-1
October 7, 2004 at 8:17 am
Cheers...
But the size of the field isn't an issue the real question is creating the identity with LastIdentity2.
Do you have any ideas?
October 7, 2004 at 8:52 am
DECLARE @tbl TABLE(Id Int , Issue CHAR(8))
DECLARE @byLoop TinyInt
SET @byLoop=1
WHILE @byLoop<32
BEGIN
INSERT @tbl(Id , Issue)
SELECT POWER(2,@byLoop-1),'Issue ' + CAST(@byLoop AS VARCHAR(2))
SET @byLoop=@byLoop+1
END
SELECT * from @tbl
October 7, 2004 at 8:55 am
Note POWER will give an arithmetic error if you exceed 31 issues because POWER can only return a 32 bit integer.
October 7, 2004 at 9:32 am
Thanks!
I think i just need to plug that into a udf and call it from the item default.
Sorry it the first time i've posted a question do i have to give you points???
Once again thanks a lot...![]()
October 8, 2004 at 6:34 am
No there's no point involved in this forum... except maybe the number of postings we do and how well we performe in the Question of the day "contest".
Viewing 6 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply