Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL and ASP using Stored Procedures
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 12/10/2001 :  01:01:45  Show Profile  Visit batgrrrl's Homepage  Reply with Quote
Hi Guys,

I would like to know if there is a way to pass back a basic record count from this query back to an asp page that called the sp?

INSERT INTO renee.dbo.po_lines
SELECT distinct po_lines.po_header_id, po_lines.po_line_num, po_lines.quantity, po_lines.unit_cost, po_lines.description, po_lines.created_by, po_lines.creation_date, po_lines.last_updated_by, po_lines.last_update_date
FROM po_lines RIGHT JOIN po_header ON po_lines.po_header_id = po_header.po_header_id
WHERE (((po_header.po_detail_status_id)= @po_status ) AND ((po_header.po_type_id)= @typeid Or (po_header.po_type_id)= @typeid2 )
(( po_header.creation_date > @sDate AND po_header.creation_date < @eDate )));

I would just like to know how many records where inserted. Can anyone help please?

Thanks thanks thanks :)

Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 12/10/2001 :  01:08:21  Show Profile  Visit Merkin's Homepage  Reply with Quote

The easiest way would be to add this after your insert :

Select @@Rowcount as HowManyRows

or something, which will actually return a single field recordset.

It would be faster though, to use an output parameter and select @@Rowcount into that.

How are you with ADO parameters ?

Go to Top of Page

Starting Member

8 Posts

Posted - 12/10/2001 :  01:11:07  Show Profile  Visit batgrrrl's Homepage  Reply with Quote
Thanks Merkin!! :)

Im mediocre with ADO :)

I should be able to work it all out!

Thanks again

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000