thanks dan
but that's what the functions are doing - i tried nesting like that and it is just as slow
what I am trying to do is to get away from repetitively getting the LAstOrderID in a nested select or function call
wish I could just get it once and set it to a variable and then call of the other functions by passing the vairable
some thing like this (doesn't work - I know - just what i'd like to do!!)
Declare @LastOrderID int
Select CustomerID, CustLastName, CustFirstname, @LastOrderID = dbo.fxGetLastOrderID(Custo
Main Topics
Browse All Topics





by: geodan7Posted on 2007-05-19 at 17:30:44ID: 19121788
It sounds like you should use nested Select statements instead of using some of the functions.
Inside your WHERE clause of your SQL query, instead of using the result of a function...use the result of an SQL query.
SELECT blah
FROM myTable
WHERE theID IS (Select MAX(id) From otherTable)
or something like that.