Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Online Members
Shine S
More...
Resources
»
.NET programming
»
Databases
Execute dynamic sql in function
Posted Date:
25-May-2010
Category:
Databases
Author:
Dilip Singh
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:
CheckSum function
Get Day Name
Ranking Functions in SQL Server 2005
Decode sql functions
Find the LENGTH of a string without using LEN Function in Sql Server
SQL DATE Time Convert
Example of SQL Server Case Conversion Functions
Date - Time Formatting in SQL
Security Principals for SQL Server
SQL Script to Concatenate column values
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!
Tweet
Responses to "Execute dynamic sql in function"
No responses found. Be the first to respond...
Feedbacks
Post Comment:
Notify me by email when others post comments to this article.
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
Sql join
Diffrence between SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY ?
Introduction to UDL in SQL
Timestamp Explanation
MSSQL 2005 Error: Cannot recover the master database
New Features in SQL Server 2008
Popular Tags
Tag posting guidelines
Search Tags
Execute dynamic sql in funtion
.
Active Members
Today
Prachi Kulkarn...
(37)
Hemanth
(25)
Prasad kulkarn...
(25)
Last 7 Days
Naved Hasan ...
(255)
naveensanagase...
(230)
Pawan Awasthi
(176)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John