TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Interesting Facts about execute command in SQL Server
Venkatesan Jayakantham
May 03, 2012
7.5
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Interesting Facts about execute command in SQL Server
Possible Error :
Procedure expects parameter '@handle' of type 'int'.
Reason for this error: From the error, you are able to predict that, the issue is due to the datatype. This issue may occur, if you are trying to execute a dynamic sql.
Try to execute the sql with sp_executesql.
Two options of executing to your sql
exec(@sql) or exec sp_executesql @sql
I've succeeded the above issue and caught up the below issue now,
Invalid use of side-effecting or time-dependent operator in 'EXECUTE STRING' within a function.
The reason is, I am trying to use the exec sp_execuesql method inside a function which is not accepted by SQL Server. Here is a fantastic guide for your apetite.
http://jimbojw.com/wiki/index.php?title=SQL_2005_-_Why_You_Can't_EXEC()_Inside_a_UDF
Cheers,
Venkatesan Prabu. J
Head, KaaShiv InfoTech,
http://www.kaashivinfotech.com/
Interesting Facts about execute command in SQL Server
Next Recommended Reading
Call or execute a Stored Procedure from Select Statement in SQL Server using OPENROWSET