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)
 Identity Column Question

Author  Topic 

BoltBait1
Starting Member

2 Posts

Posted - 2007-03-03 : 22:41:18
Is it possible to have a table with only a single identity column?

If so, how would I add a record to that table? (I understand that I would then retreive the identity number using @@IDENTITY.)

I can not add the identity column to my main table as several records there might share the same Series ID (my identity number).

Other than the Series ID, no other information would be common between the main records--I just need to know that the main records are related in some way.

Thanks in advance.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-04 : 00:15:12
[code]
create table #temp
(
[id] int identity
)

insert into #temp default values
insert into #temp default values
select * from #temp
[/code]


KH

Go to Top of Page

BoltBait1
Starting Member

2 Posts

Posted - 2007-03-04 : 00:21:09
Perfect! Just what I needed. Thanks.
Go to Top of Page
   

- Advertisement -