Subscribe to Subscribers

Online Members

Shine S
More...

Resources » .NET programming » Databases

Execute dynamic sql in function


Posted Date:     Category: Databases    
Author: Member Level: Silver    Points: 4



Hello friends ,

this is probably one my post which took me so long to varify but negligible time to write it .

We cannot execute dynamic sql in a user defined funtion.

SET @query = 'select * from nytable'

exec (@query) – this will not work

neither you can call any stored procedure from a function(except extended stored procedures).

the another possible workaround for this is that you create a stored procedure rather than a UDF or create an extended stored procedure . than you can call it as
Related Resources:


Read related articles: Execute dynamic sql function    Dynamic function SQL    SQL functions    


Did you like this resource? Share it with your friends and show your love!


Responses to "Execute dynamic sql in function"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Sql join
    Previous Resource: 6 important uses of Delegates and Events
    Return to Resources
    Post New Resource
    Category: Databases


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Execute dynamic sql in funtion  .  

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2013 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.