Donate

Joining to a Table Function in SQL Server

Following up on my previous post, SQL Server (since version 2005 while in SQL 90 compatibility mode) provides the ability to join to the table created by a parameterized table function. In earlier versions you were not able to use a table function with a dynamic parameter or even join to it. If you needed this functionality your best bet was a stored procedure.

So in my case I was refactoring some code to correct for a Powerbuilder datawindow issue and needed to split up a block of text from a table into individual rows based on the carriage return / linefeed codes contained within it. Since I needed additional data from another table to properly group the data I came up with the following as a datasource for the datawindow.

You must be logged in to post a comment. If you choose to login - or register - on this site, a non-tracking cookie will be stored on your computer but your email address will never be published or shared.