Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP / Macro substitution / SQL Equivalent
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01029644
Message ID:
01029652
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Does SQL Server have the capability of storing a stored procedure in a varchar or text field and then calling that stored procedure from another (currently executing) stored procedure.
>
>I'm looking for an equivalent to VFP'c ability to use macrosubtitution to store program logic in a variable and then execute it when desired.
>

You can use dynamic SQL with EXECUTE command or sp_executesql stored procedures. See Re: Using a variable in the FROM clause of a SELECT Message #877130 and Re: Dynamic SQL Thread #907431, for example. Check also How to return a value from dynamicaly executed T-SQL code FAQ #8130.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform