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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting and reading values in Stored Procedures

Status
Not open for further replies.

freewilly

Programmer
Joined
Feb 19, 2001
Messages
43
Location
AU
Hi team
I'm trying to insert values into a table and read then back with the same sp with:

Insert into Sales Values(1,2,44.99)
Select * from Sales

When I check the table the values are there. When I run the sp from Query analyser I get the correct results. When I run the query minus the Insert from VB using ADO I get the correct results. However nothing is returned if the sp contains both the the insert and select!

What am I missing?

Cheers
 

Add the command SET NOCOUNT ON before the INSERT in the stored procedure.

Set nocount on
Insert into Sales Values(1,2,44.99)
Select * from Sales Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top