RE: SQL Server Question (Way OFF TOPIC SORRY)

From: "Dwelle, Timothy" <TDwelle(at)xperts(dot)com>
To: "'Mirko Geffken '" <mgeffken(at)corcoranweb(dot)com>, "'PostgreSQL General '" <pgsql-general(at)postgresql(dot)org>
Subject: RE: SQL Server Question (Way OFF TOPIC SORRY)
Date: 2000-07-05 20:16:46
Message-ID: 5B7C00CB140FD4119B4E00508BA54CD504AC43@mail.xperts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

if memory serves, after the insert do a:

SELECT @@IDENTITY

but why would you want to use m$ sql server?
it doesn't even run on linux... :-)

-tim.

-----Original Message-----
From: Mirko Geffken
To: PostgreSQL General
Sent: 7/5/00 3:34 PM
Subject: [GENERAL] SQL Server Question (Way OFF TOPIC SORRY)

Hi,

I know this is way off topic (with this being a PostgreSQL mailing
list),
but I couldn't find one.

Does anyone know of a SQL Server mailing list.

In case anybody knows the answer here, here is my question:
I want to insert into a table with an identity field and get the
identity
field's value returned immediately
e.g.
CREATE TABLE x
(
id IDENTITY(1,1),
y INT
);

INSERT INTO x(y) VALUES (2)

In Oracle you can do something like:
x:=INSERT INTO x(y) VALUES (2) RETURNING id (forgot exact syntax)

Does anyone know of a safe (meaning works with concurrent users)
solution for SQL Server?

Thanks for your time and I apologize for the off topic message
Mirko

Browse pgsql-general by date

  From Date Subject
Next Message mikeo 2000-07-05 20:23:54 Re: responses to licensing discussion
Previous Message Tom Lane 2000-07-05 20:02:43 Re: PostgreSQL 7.1