473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Stored Procedures and Commiting Data

I have a Stored procedure on a SQL 2005 server.

It inserts a new record into t_people and correctly retrieves the id
using SCOPE_IDENTITY.

It then calls another SP that takes the ID of the new record in
t_people as a parameter.

When the second SP queries t_people to find the data for the person,
it can't see the row and returns EOF.

Is there something I need to do in the first SP to commit the new data
before other SP's can see it?
Jun 27 '08 #1
2 1195
<option value="13315">Jackson, Duane | | Duane Jackson</option>
(du***@kashflow.co.uk) writes:
I have a Stored procedure on a SQL 2005 server.

It inserts a new record into t_people and correctly retrieves the id
using SCOPE_IDENTITY.

It then calls another SP that takes the ID of the new record in
t_people as a parameter.

When the second SP queries t_people to find the data for the person,
it can't see the row and returns EOF.

Is there something I need to do in the first SP to commit the new data
before other SP's can see it?
No.

I would suggest that you post your code, so that we can getter better
grip of what you are doing.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 27 '08 #2
On Jun 9, 11:05*pm, "<option value=\"13315\">Jackson, Duane | | Duane
Jackson</option>" <du...@kashflow.co.ukwrote:
I have a Stored procedure on a SQL 2005 server.

It inserts a new record into t_people and correctly retrieves the id
using SCOPE_IDENTITY.

It then calls another SP that takes the ID of the new record in
t_people *as a parameter.

When the second SP queries t_people to find the data for the person,
it can't see the row and returns EOF.

Is there something I need to do in the first SP to commit the new data
before other SP's can see it?

hi,the @@IDENTITY can help your.

when your insert a new record. your can used the @@IDENTITY to get the
id.
code:
INSERT INTO T_TABLE (xxxx) VALUES (xxxx)
SELECT @@IDENTITY
Jun 27 '08 #3

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

Similar topics

2
by: Eli | last post by:
Hi all We currently have a strange problem with calling a Stored Procedure (SQL Database) in our C# Project. The only error I get is "System error" which says a lot :) Background: We have...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
45
by: John | last post by:
Hi When developing vb.bet winform apps bound to sql server datasource, is it preferable to use SELECTs or stored procedure to read and write data from/to SQL Server? Why? Thanks Regards
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.