Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table-Valued Function - Returning Specific Column Values in Stored Procedure 1

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
0
0
US
Hello,

I have 6 possible values that can appear for 6 columns in a join table. Is it possible to return specific column values from a table-valued function and map those values to these columns? If so, could someone please provide a quick snippet or link to where I could see a code sample of this?

I am trying to avoid writing 6 separate scalar functions. Hope this makes sense.

Thanks,
Larry
 
You can use table-valued function as an ordinary table, just give it an alias:
Code:
SELECT Something
FROM MyTable
INNER JOIN dbo.TableFunction Tbl1 ON MyTable.Cloumn1 = Tbl1.ColumnName ...

Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top