» Using Table valued Function in join
Using Table valued Function in join
|October 11, 2012
Posted by forumadmin
There is a Table valued function which gives multiple rows as output and there are 2 columns as output.
Now I want use this function in the query for all the employees in the employees table
I am using CROSS APPLY but its taking long time and doesn’t give any result.
This is the query which I tried
from emp A Cross APPLY fnempDiv(A.EmpID)
More Related Questions
- How to use CROSS APPLY XML PATH How can I use CROSS APPLY and FOR XML to normalise the table which contains a list for informartion?
It should be normalised […]
- Error : Invalid length parameter passed to the LEFT or SUBSTRING function My Function is as Following ::
Create Function dbo.fnFcid(@url varchar)
Return ( select ID from TTI_fat.dbo.FormContext
where caseId = (SELECT […]
- How to remove diagramming support objects from SQL Server? I need to remove diagramming support tables, stored procs, views, etc from SQL Servrer using TSQL script.
Is there such a script available?
SQL 2005 and 2008. Asked By - […]
- Using cross apply in update statement Is it possible to use the cross apply clause in the from part of an update statement, in SQL Server 2005? Asked By - guillegr123 Read […]
- Obtain maximum row_number inside a cross apply I am having trouble in calculating the maximum of a row_number in my sql case.
I will explain it directly on the SQL Fiddle example, as I think it will be faster to understand: SQL […]
- How to retrieve unique records having unique values in two columns from a table in SQL Server I want to query a table where I need the result that contains unique values from two columns together. For e.g.
EnquiryId | EquipmentId | […]
- simplify SQL statement by using CTE I have a query like the following:
SELECT A.a, A.b, B.c,
(CASE WHEN ... THEN ... ELSE ... END) AS CalculatedValue,
FROM dbo.TableA A INNER JOIN
dbo.TableB B ON (...)
- Limit select size of all user queries Stupid question as it sounds but is there any way to implement select size limitation to specific users on SQL Server? Even though a user sends select *, the result set will contain only […]
- The equivalent of cross apply and select top I have table (script below):
if db_id ( 'CrossApplyDemo' ) is not null
drop database CrossApplyDemo
create database CrossApplyDemo
- SQL complex unions This is a little tricky to describe, but hopefully there is a solution.
I have a UDF which takes an ID and returns a table. Is there a way I can do a SELECT for these IDs and perform a […]