473,471 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pass Scope_Identity() back to the calling application

I'm using an Access2K front end on a SQL Server2K backend.
I use Scope_Identity() in a lot of stored procedures to pass the
newwly inserted record's unique ID to the next select statement in the
same stored procedure.
What I'm wondering is how I can pass the Scope_Identity back to the
calling application.
I'm hoping someone can show me the SP code and the aceess code needed
to accomplish the following:

I insert a new record in a table with a stored procedure. The SP
passes the uniqueID (Scope_Identity) back to MS Access, then MS Access
uses the uniqueID when calling another function...

thanks
Jul 20 '05 #1
1 2525
Hi

Check out the following that shows how to use stored procedures and output
parameters.

http://msdn.microsoft.com/library/de...tml/sa00i8.asp

John

"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I'm using an Access2K front end on a SQL Server2K backend.
I use Scope_Identity() in a lot of stored procedures to pass the
newwly inserted record's unique ID to the next select statement in the
same stored procedure.
What I'm wondering is how I can pass the Scope_Identity back to the
calling application.
I'm hoping someone can show me the SP code and the aceess code needed
to accomplish the following:

I insert a new record in a table with a stored procedure. The SP
passes the uniqueID (Scope_Identity) back to MS Access, then MS Access
uses the uniqueID when calling another function...

thanks

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marcus | last post by:
With a query such as, SET NoCount ON INSERT INTO .... VALUES ... SELECT scope_identity() SET NoCount OFF , can I trust that the id I get back is for the row that I just inserted, or can it...
5
by: Larry | last post by:
I am seeing a problem with an ASP application, where I have 2 tables. In the first table, the ASP inserts just 1 row and retrieves the primary key of the new row using SCOPE_IDENTITY. It then uses...
1
by: NorrYtt | last post by:
I am having a problem with passing a function as a parameter to my DLL so it can call it back with updates. The DLL is written in LabWindows CVI with some #ifdef 'C'-style wrappings. The...
1
by: Justyn | last post by:
Hi everyone, I hope someone can help me out! I have added a trigger that gets fired on INSERT and which itself inserts data into another table WITHOUT an identity I used to get back the...
0
by: blouie | last post by:
I'm combining a "SELECT Scope_Identity..." statement with an insert statement in my InsertCommand. When I try to retrieve the value into a variable, it generates an error stating that my collumn...
1
by: =?Utf-8?B?RGV2YW4=?= | last post by:
Hi, I have a table adapter for a database with an insert query. I want to be able to get the PRIMARY key of the inserted record for that insert statement. I know that SCOPE_IDENTITY is the...
10
by: Mike | last post by:
Sql Server, Scope_Identity(), Ado.NET: Which is better? Using an output parameter to return Scope_Identity through ExecuteNonQuery(), or adding Select Scope_Identity() to the end of the...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
3
by: Miro | last post by:
I am trying to get my ID added from a people table in an access table "MyContacts.mdb" i just added. Its basically a contact file i created in access: PK Person_ID - Unique - autoincrement...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.