The Below code gives on how to return Table data from a function in FROM Cluase sub-query
CREATE FUNCTION fncGetAuthorsByState(@vchState AS CHAR(2)) RETURNS TABLE AS RETURN ( SELECT au_lname + ', ' + au_fname AS 'Name', phone, address, city, state, zip FROM authors WHERE state = @vchState )
SELECT * FROM fncGetAuthorsByState('CA')
|
No responses found. Be the first to respond and make money from revenue sharing program.
|