Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there anyway of using the @@IDENTITY value in interdev

Status
Not open for further replies.

bryant89

Programmer
Nov 23, 2000
150
CA
I am having trouble with an sql query in interdev.

I am trying to retrieve the identity using the @@IDENTITY value but for some reason it will not work.
Here is my code

Alter Procedure stpCreateReturn

@copName varchar(70),
@copCity varchar(40),
@copProv char(2),
@copCountry varchar(30),
@copAddress varchar(70),
@copStatus varchar(70),
@copEstCost money

AS

INSERT INTO tblContProj (copName, copCity, copProv, copCountry, copAddress, copStatus, copEstCost)
VALUES (@copName, @copCity, @copProv, @copCountry, @copAddress, @copStatus, @copEstCost)

SELECT @@IDENTITY
GO
return


The insert works fine but the select does not.
Any help would be Appreciated

Bryant
 
Bryant,

Take that to the Tek-Tips SQL Server forum. There are some very knowledable people in that forum. I'm sure they can answer that question.

-pete
 
Thanks Pete.

I figured it out finally.

It took a while though.
 
Hi Bryant,

I have the same problem... how did you get your procedure to return the identity value?

My Procedure is almost identical... I have used both syntaxes within the procedure :

return @@Identity
select @@Identity

Within Interdev I use DataEnvironment Command to execute procedure:

IntCurrCompany = DE.cmdAddCompany(strname,strtype,stradd1,stradd2,strcity,strstate,strcountry,strpostalcode,strcontact,strphone,strextension,strfax,stremail)

Nothing seems to get returned within IntCurrCompany?!

Your help would be appreciated... Thanks!


 
Have a look at thread117-236176 which talks about this issue.

I notice that you return the identity value as a result set. It is possible to just use the 'return' value of the stored procedure - though some folk have problems with this too (see the thread). (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top