July 3, 2012 at 1:18 pm
I have a scenario in which i need to get through different values (table) returned from The function and use this function to join with table??
Is that possible??
July 3, 2012 at 1:21 pm
That is possible.Are you going to call the function for each row in the table?Or are you trying to join the output of the function (where the output of function is independent of the data in the joining table) with table?
GulliMeel
Finding top n Worst Performing queries[/url]
Improve the performance of Merge Join(special case)
How to Post Performance Problem -Gail Shaw[/url]
July 3, 2012 at 1:22 pm
it depends. way to vague to really answer. can you post a more detailed explanation and some DDL, Sample data, and expected results?
See the first link in my signature for the best way to post the DDL and Sample data.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
July 3, 2012 at 2:18 pm
Yes, I am trying to join the output of the function (where the output of function is independent of the data in the joining table) with table?
example
I have a function passing some values which will return startdate, end date , completed time and the step_name and ID
and I need to join that Id with the Main table to get some other values in my result.
Can you give some example of syntax??? How to write this in SQL or any link??
July 3, 2012 at 2:20 pm
komal145 (7/3/2012)
Yes, I am trying to join the output of the function (where the output of function is independent of the data in the joining table) with table?example
I have a function passing some values which will return startdate, end date , completed time and the step_name and ID
and I need to join that Id with the Main table to get some other values in my result.
Can you give some example of syntax??? How to write this in SQL or any link??
You are going to have to show us what you are trying to accomplish. Please provide the DDL for the tables and functions involved, sample data for the tables, and expected output you'd like to see based on the sample data you provide.
July 3, 2012 at 2:53 pm
CELKO (7/3/2012)
The short answer is that good programmers do not use table valued functions. They are proprietary, screw up the optimizer and require disk access so they are slow.Instead we have derived tables. VIEWs and CTEs which are portable, faster and can be optimized.
Good programmers, meaning those that adhere to your principles of writing nothing but STANDARD SQL code, and avoiding ALL dbms specific features even if using those features can provide improved performance and scalability.
Use the tools you have available and learn to use them right. It isn't like you change DBMS's like you change light bulbs or anything like that.
July 3, 2012 at 2:56 pm
CELKO (7/3/2012)
The short answer is that good programmers do not use table valued functions. They are proprietary, screw up the optimizer and require disk access so they are slow.Instead we have derived tables. VIEWs and CTEs which are portable, faster and can be optimized.
Celko that's a plain, shortsighted answer, and very misleading on a SQL Server specific forum. Good programmers use the best most efficient tools available for the task on hand.
you cannot say don't use proprietary stuff, and then in the same sentence say that the SQL Server proprietary optimizer will not handle it correctly.
that's just incorrect and you should know better.
Like any method, a table value function can be misused or written incorrectly, the same as a a CTE, view or derived table as well.
Lowell
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply