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

executing stored procedure

Status
Not open for further replies.

taval

Programmer
Jul 19, 2000
192
GB
I have a stored procedure in an SQL sever, I have copied exactly how it looks:<br><br>-----------------------<br>-- Users Not backed for set time <br>-- Remember the @days value must be a negative value<br>CREATE PROCEDURE sp_usersnotbackedup<br><br> @days int<br><br>AS<br><br>SELECT Customer.CustID, Customer.CustName, MAX(FileDescription.UploadDate) AS LastModified <br>INTO #tempCust <br>FROM Customer INNER JOIN FileDescription ON Customer.CustID = FileDescription.CustId <br>GROUP BY Customer.CustID, Customer.CustName <br><br>if exists (select * from sysobjects where id = object_id(N'[dbo].[tempNotBackedUp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)<br>drop table [dbo].[tempNotBackedUp]<br><br><br>select * <br>into tempNotBackedUp<br>from #tempcust <br>where LastModified &lt; DATEADD(day,@days,GETDATE())<br><br>select * from tempNotBackedUp<br> <br><br>/*<br>SELECT Customer.CustID, Customer.CustName, FileDescription.LastModified <br>FROM Customer INNER JOIN FileDescription ON Customer.CustID = FileDescription.CustId <br>WHERE (FileDescription.LastModified &lt; DATEADD(day, @days, GETDATE()))<br><br>*/<br>--------------------------------------------<br><br>the procedure requires a variable @days, my question is how do I use this procudure through ASP and get the results. I have never used stored procedures before, grateful for any help thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top