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 |
|
dragon300zx
Starting Member
4 Posts |
Posted - 2008-01-15 : 10:21:17
|
| Hello everyone,Let me start by saying I am relatively new to all of this and although I have worked with SQL before it was for very specific items and very simple things. I am now tearing apart some dts's and trying to explain them and am running into some issues and was hoping to get some help. For starters I don't understand what this is doing. My notes are in ""."This part I get is inserting into the account field on my table"INSERT INTO transLoanMaster (Account)"and I understand that this is selecting the fundedloannum as the account number"SELECT Towne.dbo.LoanTracking.FundedLoanNum AS Account"and I get that this is coming from the loanlog table"FROM Towne.dbo.LoanLog "I don't get what "right outer join" is"RIGHT OUTER JOIN Towne.dbo.LoanTracking ON Towne.dbo.LoanLog.LoanCaseId = Towne.dbo.LoanTracking.LoanCaseId"I understand this is giving guidlines as to when to get the information however I don't understand what "> CONVERT(varchar, GETDATE() - 30, 101))" means." WHERE (Towne.dbo.LoanLog.EnteredDtTm > CONVERT(varchar, GETDATE() - 30, 101)) AND (Towne.dbo.LoanLog.DataWasChangedFlag = 'Y') OR (Towne.dbo.LoanTracking.UpdateDtTm > CONVERT(varchar, GETDATE() - 30, 101))GROUP BY Towne.dbo.LoanTracking.FundedLoanNumany help especially with the "right outer join" and "> CONVERT(varchar, GETDATE() - 30, 101))" would be greatly appretiated. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2008-01-15 : 10:41:50
|
| is looking for records > 30 days old. not the best way to do it, but acceptableright outer join:select all records from the table right of join operator and their matching records in the table left of it |
 |
|
|
dragon300zx
Starting Member
4 Posts |
Posted - 2008-01-15 : 10:49:11
|
| Thank you very much russell. I appreciate the help, if I can ever be of assitance with networking or hardware issues let me know. |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2008-01-15 : 12:08:33
|
glad to help. i want to clarify the date part. it is looking for records NEWER than 30 days old. hope my vague explanation didn't mislead u. |
 |
|
|
dragon300zx
Starting Member
4 Posts |
Posted - 2008-01-15 : 12:30:06
|
| nah once I saw the 30 days I figured it to be less than 30 days old based on the type of information it is. |
 |
|
|
dragon300zx
Starting Member
4 Posts |
Posted - 2008-01-15 : 13:40:07
|
| Ok If anyone is still looking at this I have another DTS question.Here is my interpretation of the dts.Update transLoanMaster so the transLoanMaster.LoanBorrLastName is equal to towne.dbo.Borrower.LastName from towne.dbo.LoanTracking when the LoanCaseID is equal on (or BorrId is equal on (or located in towne.dbo.Borrower ) Towne.dbo.Borrower and Towne.dbo.Employment) towne.dbo.LoanTracking and towne.dbo.Borrower where towne.dbo.Borrower.CoborrFlag = 'N' and towne.dbo.Borrower.BorrPairSeqNum=1 and towne.dbo.LoanTracking.FundedLoanNum = transLoanMaster.AccountHere is the DTS.UPDATE transLoanMasterSET transLoanMaster.LoanBorrLastName = towne.dbo.Borrower.LastNameFROM towne.dbo.LoanTracking INNER JOIN(towne.dbo.Borrower LEFT JOIN Towne.dbo.Employment ON Towne.dbo.Borrower.BorrId = Towne.dbo.Employment.BorrId) ON towne.dbo.LoanTracking.LoanCaseId = towne.dbo.Borrower.LoanCaseIdWHERE (towne.dbo.Borrower.CoborrFlag = 'N') AND (towne.dbo.Borrower.BorrPairSeqNum = 1) AND towne.dbo.LoanTracking.FundedLoanNum = transLoanMaster.AccountDid I interpret this correctly? |
 |
|
|
|
|
|
|
|