All,
We’d like to be able to select records from a table where we use an Expression
in a SelectQuery for most attributes, but then we want to limit the query to an
IN or EXISTS qualifier as well. We’d rather not bring all the objects back
just so we can do the query, so we’d like to add something like this:
Where exists (select 1
From dbo. udf_portfolio_list(@root_port_num) p
Where ti.real_port_num = p.port_num and
p.port_type = ‘R’)
udf_portfolio_list is a function defined in SQL Server that can find all the
children of a top level portfolio in a hierarchical structure. This could be
quite a large set, which is why we want to push this off to the DB server.
Ideally, we could build an expression using the standard tools, then just add
on a raw SQL expression to call the function.
What’s the best way to accomplish this?
Many thanks,
Ken
Confidentiality Notice: This e-mail and accompanying documents contain
confidential information intended for a specific individual and purpose. This
e-mailed information is private and protected by law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying, or
distribution, or the taking of any action based on the contents of this
information, is strictly prohibited.