Current Framework 2.0/3.0.
...
In Sql Server, there is a way to generate consecutive guid's.
newsequentialid.
Is there a way to reproduce this type of consecutive guid's in the
framework.
I found some info about uuidgen , but that seems like a command line prompt
tool, not a class library.
I'd like to be able to throw an int value (N) at it, and it return N
consecutive guid's.
.........
Here is a test stored procedure I wrote to show you what I'm talking about.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[uspNewSequentialUUIDCreateRange]') AND type in (N'P',
N'PC'))
DROP PROCEDURE [dbo].[uspNewSequentialUUIDCreateRange]
GO
CREATE PROCEDURE [dbo].[uspNewSequentialUUIDCreateRange] (
@newUUIDCount int --return
)
AS
SET NOCOUNT ON
declare @t table ( dummyid int , entryid int identity(1,1) , uuid
uniqueidentifier default newsequentialid() )
insert into @t ( dummyid ) select top (@newUUIDCount) 0 from dbo.sysobjects
so with (nolock)
select entryid , uuid from @t
SET NOCOUNT OFF
GO
/*
--START TEST
set nocount ON
Create Table #HolderTable (entryid int , uuid uniqueidentifier )
declare @NewUUIDCount int
select @NewUUIDCount = 20
INSERT INTO #HolderTable EXEC dbo.uspNewSequentialUUIDCreateRange
@NewUUIDCount
select * from #HolderTable
DROP Table #HolderTable
--END TEST CODE
*/