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
 SQL Server Development (2000)
 Creating the Equivalent to IDENT_CURRENT('Table_Name') In SQL 7.0

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-01 : 07:25:23
Mark writes "I would like to create an IDENT_CURRENT('Table_Name') function to use in SQL 7.0. It doesn't need to be the same. I just need to be able to get the next IDENTITY number that is going to be used on a specific table. I would guess that this is in the system tables somewhere. I am creating a login ID using this number on a table, however MAX doesn't work since the table may not contain any records and records with larger Identities may be deleted. I just want to always use an incrementing value as part of the Login ID. Thanks!"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-01 : 07:26:12
Well, you can't create user-defined functions in SQL Server 7.0, but the DBCC CHECKIDENT command should be able to help you out. Books Online has more details about it.

Go to Top of Page
   

- Advertisement -