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

Search results for query: *

  1. ccampbell

    3 table join - need to return single record

    Thanks, I was able to get it and it looks like it is working correctly. I need to do further testing on it, but it appears now that it is working. I had to modify the query a bit for my purposes but finally got it. Thanks again.
  2. ccampbell

    3 table join - need to return single record

    When I take your query and paste it into SQL analyzer I get the following 3 errors Msg 8156, Level 16, State 1, Line 1 The column 'Id' was specified multiple times for 'TB'. Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "TableB.Id" could not be bound. Msg 8156, Level 16, State...
  3. ccampbell

    3 table join - need to return single record

    This helps me with the sub select structure, thanks a lot. When I break the query down and run it piece by piece, I notice the the inner most select statement Select Id, max(Update_date) As UpdateDate From TableC Group By Id returns the single record like I am anticipating. When I add the...
  4. ccampbell

    3 table join - need to return single record

    Thanks kaht. That is currently what I have, but table B and table C have the capability to have multiple rows for each parent record. I need to return every row in the parent table (table A) and then a single element in table B based on the most current row (determined by date column in the...
  5. ccampbell

    3 table join - need to return single record

    Sorry, max record should be defined as the record with the most current date in each of the child tables. So something like select max(update_date) from table B, etc.
  6. ccampbell

    3 table join - need to return single record

    Hello, I have 3 tables Table A - Parent Table Table B - Child of A with a 1...n relationship Table C - Child of A with a 1...n relationship When I do a simple select SELECT * FROM table A x left outer JOIN table B y on x.id = y.id left outer JOIN table C z on x.id = z.id It will return...
  7. ccampbell

    SQL optimization

    Is there a more efficient way to do things aside from the way that I am currently doing them?
  8. ccampbell

    SQL optimization

    Just a question for all of you gurus out there. I am currently running insert and update SQL statements similar to the following: PRINT 'UPDATING Table1 UPDATE Table1 SET val1 = X.val1, val2 = X.val2 FROM XML_Table1 X WHERE Table1.VIN=X.VIN PRINT 'INSERTING INTO Table1...
  9. ccampbell

    user action on key stroke

    I understand that, but is there a way to take a browser action like a button click or a key stroke and execute a task on an object that I have created server side?
  10. ccampbell

    user action on key stroke

    I have created and opened and executed a task on an object in my asp code like below set obj = Server.CreateObject("....") obj.Open (... , ...) obj.Exec (task1) I need the user to be able to click a button or perform a keystroke that will execute "task2" on that same object. I am having...
  11. ccampbell

    XPATH XmlNode question

    I have an XML doc - <Permit_Table> - <Row> <PermitType2>EX LNTH/EX WGT</PermitType2> <PermitNumber>06013620</PermitNumber> <ExpireDate>01/01/2007</ExpireDate> <PermitType>ANNUAL</PermitType> <PermitValid>VALID</PermitValid> </Row> - <Row> <PermitType2>EX LNTH/EX...
  12. ccampbell

    Cascade Delete Problem

    Thank you, that answers it.
  13. ccampbell

    Cascade Delete Problem

    Excellent, that works great. I appreciate all of your help on this. It was very helpful for me. One last question, how do I release the #del_t4 ... variable so taht I can run the procedure over and over. Right now, unless I rename the variables, I get a SQL error saying it already exists...
  14. ccampbell

    Cascade Delete Problem

    That won't work. I have tried that. SQL 3 works fine, SQL 1 works fine, but then SQL 2 (which contains a join to t1) returns 0 rows affected and does not delete the record needed due to the join it has to t1 who's record was deleted in the previous step (SQL 1). Any other ideas?
  15. ccampbell

    Cascade Delete Problem

    I get a foreign key constraint error when I run them in reverse order. I get that error on the second SQL
  16. ccampbell

    Cascade Delete Problem

    Okay, the selects work fine when I run them but the deletes give me a foreign key constraint error on the second SQL. The other problem I have is after I run teh first SQL, the other 2 SQL's don't delete anything because there is nothing to join to. Any ideas?
  17. ccampbell

    Cascade Delete Problem

    Thank you, that is what I was missing.
  18. ccampbell

    Cascade Delete Problem

    These return me a null set when I run them. I modified them slightly to perform a select rather than a delete so I could see the record results. In my test database I have 2 records, one of which I need to clean up because it has an older update date. The first query I am running is as...
  19. ccampbell

    Cascade Delete Problem

    I will give it a try and see what I come up with. Thanks for the reply. Is this the best way to accomplish this?
  20. ccampbell

    Cascade Delete Problem

    I have a very complex problem that I need some assistance with for anyone willing to tackle this. Here is the situation. I have 4 relational tables (T1, T2, T3, T4). T1 is the parent table with the PK being v_seq_num. T3 has a pk of l_seq_num. T2 contains an update_date field that I need to...

Part and Inventory Search

Back
Top