Insert into with the key word returning ??

bghanim

Active member
Joined
Dec 5, 2006
Messages
40
Location
Abu Dhabi - UAE
Programming Experience
1-3
Hello all,
Is there an insert statment with the keyword returning in sql Server 2000 ?

for example,


insert into table_name (fname, lname, age)
values ('Baha', 'Ghanim', 23)
returning id into @tmp


table_name structure:
id = primary key
fname
lname
age

I've used this statement in Oracle, but Ineed something like it with sql Server 2000
 
Last edited:
Please clarify your query.

:) Seriously though, I can't understand what you want to do. Maybe you could show how you did it with Oracle.
 
insert into table_name (fname, lname, age)
values ('Baha', 'Ghanim', 23)
SET @id = Scope_Identity()

.. that's assuming that your PK field is an Identity field.

-tg
 
Back
Top