Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Most Efficient Way?

Author  Topic 

Trent
Starting Member

39 Posts

Posted - 2004-12-17 : 10:22:02
This should be overly simple, but my head is mush after putting in over 10 consecutive hours here.
What would be the quickest way to do the following:

CREATE PROCEDURE usp_NextAvailableIDBySite
@SAElse varchar(4)
AS
set nocount on
if @SAElse = 'SA'
Begin
--cycle through table tTester to find the
--next unused TesterID(between '2000000' and '3999999')
end
else
if @SAElse = 'Else'
Begin
select TesterID
--cycle through table tTester to find the
--next unused TesterID(between '8000000' and '9999999')
End
GO

Trent
Starting Member

39 Posts

Posted - 2004-12-17 : 11:21:13
Resolved
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-12-17 : 11:22:43
how?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2004-12-17 : 12:04:43
TEN HOURS??!?!??!?!?! You must be exhausted!!!

HTH

=================================================================

Happy Holidays!
Go to Top of Page
   

- Advertisement -