Afficher un message
Vieux 19/09/2007, 03h21   #1
mcleana@sympatico.ca
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Using Scalar functions in views

I have a view that contains a complex query. A few of the columns
call a function that returns a specific output. I also use a function
to do a join as well.

For example:

SELECT l.ID, dbo.getStatus(l.ID) AS statusID
FROM tableName A
LEFT OUTER JOIN dbo.Status_LKP s ON dbo.getStatus(l.Leg_ID) =
s.statusID

For 800 records, this query takes about 9 seconds. I realize that for
each record, the function is executed on a per row basis, so I am
looking for alternatives.

Does anyone know of other ways to accomplish something of the same?
Basically I would like to include UDFs in a query and use those UDFs
in the where and join clauses.

Thanks

  Réponse avec citation
 
Page generated in 0,05168 seconds with 9 queries