Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table valued inline function syntax
Message
From
03/02/2014 10:11:56
 
 
To
03/02/2014 09:58:09
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01592983
Message ID:
01592994
Views:
28
Well, first, owe you an apology. Had forgotten this - TVFs (either single line or multiline) can't return dynamic SQL. They go by stricter rules than regular stored procedures. For lack of a better term, they have stricter design-time binding. I thought there was a workaround but apparently there isn't.

You can have a stored procedure that receives all the information and constructs the syntax and result set dynamically. That will work....though you're subject to the rules about the result set and what you can do with it. (If you want to join the results of a proc to another table, you have to redirect the results to a table or temp table)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform