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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Unable to move to next Select and If-then statemen

Author  Topic 

edb2003
Yak Posting Veteran

66 Posts

Posted - 2003-08-08 : 12:01:36
If you have seen this part noted, please go to **** The Code *****

I have 3 different tables ... a, b, c
I have 3 different seach asp pages a.asp, b.asp, c.asp
from MasterPage.asp.

search a.asp does a search between tables a and c and does a post.
search b.asp does a search between tables a and b and does a post.
search c.asp does a search only in table a.

How can I make 1 search page to do all 3?

**** The Code *****

I have 4 functions to 1 asp page doing the above I start with
a select statement and an if then statement pulling data from two databases.

I have to use this script below to weed out the duplicate records however it stops the process of me having to move to the next Select and IF then statement.

Dim TempFileName

TempFileName= OldFileName

while (TempFileName = objRS_ECN("Drawing Num"))

objRS_ECN.movenext
if (objRS_ECN.EOF)then
'Response.end
'TempNum = RecordCount
end if

wend

objRS_ECN.MoveNext
LOOP

The problem has to do with the Response.end function. What string can I use to have this process move out of the loop and into the next if then statement?

I really appreciate your help :)

thx,
Ed


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-08 : 12:28:04
Why aren't you doing this in stored procedures?

Tara
Go to Top of Page

edb2003
Yak Posting Veteran

66 Posts

Posted - 2003-08-08 : 14:32:21
Thanks for your input Tara.

How would the stored procedure be made so that I can run 3 different View Statements into 1 Stored Procedure? I am new to SQL and I have made stored procedures by simply using connecting to 1 view but not to 3.

Appreciate your help :)
Ed
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-08 : 14:36:39
A stored procedure that selects from 3 different views:

CREATE PROC usp_SampleProc
(@input1 INT)
AS

SET NOCOUNT ON

SELECT Column1, Column2, Column3
FROM View1
WHERE Column1 = 100 AND Column2 = @input1

SELECT ColumnA, ColumnB, ColumnC
FROM View2
WHERE ColumnB IS NOT NULL AND ColumnA <> @input1

SELECT Column1A, Column2B, Column3C
FROM View3
WHERE Column3C = 'SQLTeam' AND Column2B = @input1

RETURN

Tara
Go to Top of Page
   

- Advertisement -