main logo
Subject: Re: Converting an app to use remote views
Author: Bob Archer
Posted: 2001/03/06 17:20:53
 
View Entire Thread
New Search


Opps... there was an END missing in there... here is the corrected.

Here is an sp_NewID():

CREATE PROC sp_NewID

@basetablename varchar(30) = 'default'

AS

Declare @returnNewID int

BEGIN TRANSACTION NewID

SELECT @basetablename = LOWER( (at) basetablename)

IF NOT EXISTS (SELECT *
FROM sy_uniqueid
WHERE sy_uniqueid .DOT tablename = @basetablename)
BEGIN
INSERT INTO sy_uniqueid
VALUES (@basetablename
,0)
END

Update sy_uniqueid
SET last_id = last_id + 1
, (at) returnNewID = last_id
WHERE sy_uniqueid .DOT tablename = @basetablename

COMMIT TRANSACTION NewID

Return @returnNewID

*****************
BOb
</font></i>


 
©2001 Bob Archer
<-- Prior Message New Search Next Message -->