Please start any new threads on our new site at http://forums.sqlteam.com. 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
Username:
Password:
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  

batgrrrl
Starting Member

Australia
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 )
AND
(( 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 :)

Merkin
Funky Drop Bear Fearing SQL Dude!

Australia
4970 Posts

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

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 ?


Damian
Go to Top of Page

batgrrrl
Starting Member

Australia
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-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000