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.
| 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, cI have 3 different seach asp pages a.asp, b.asp, c.aspfrom 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 TempFileNameTempFileName= OldFileName while (TempFileName = objRS_ECN("Drawing Num")) objRS_ECN.movenext if (objRS_ECN.EOF)then 'Response.end 'TempNum = RecordCount end ifwendobjRS_ECN.MoveNextLOOP 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 |
 |
|
|
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 |
 |
|
|
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)ASSET NOCOUNT ONSELECT Column1, Column2, Column3FROM View1WHERE Column1 = 100 AND Column2 = @input1SELECT ColumnA, ColumnB, ColumnCFROM View2WHERE ColumnB IS NOT NULL AND ColumnA <> @input1SELECT Column1A, Column2B, Column3CFROM View3WHERE Column3C = 'SQLTeam' AND Column2B = @input1RETURNTara |
 |
|
|
|
|
|
|
|