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.
Author |
Topic |
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2014-02-07 : 04:16:57
|
if i run
insert into images(date,picture) select date from #t2
how can I get a list of the inserted id's?
(the @@identity of each record inserted?) |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2014-02-09 : 01:51:41
|
thanks i need to debug this more
if i do the following as a test
create table #id ( id int );
insert into images(date,picture) select date,picture, from images where dateinserted>'20140209' output inserted.id into #id (id)
select * from #id
i get an error Incorrect syntax near 'output'.
|
 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2014-02-09 : 02:07:26
|
i figured this out - output has to be before the values inserted thanks for your help |
 |
|
|
|
|