IT Community - Software Programming, Web Development and Technical Support

Difference Between Exec() and sp_executesql in Sql Server

This is a discussion on Difference Between Exec() and sp_executesql in Sql Server within the Database Support forums, part of the Web Development category; Difference Between Exec() and sp_executesql The difference between the EXEC() and sp_executesql is that the former takes SQL statement in ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-19-2008, 03:18 AM
vadivelanshanmugam vadivelanshanmugam is offline
D-Web Trainee
 
Join Date: Jan 2008
Posts: 41
vadivelanshanmugam is on a distinguished road
Default Difference Between Exec() and sp_executesql in Sql Server

Difference Between Exec() and sp_executesql

The difference between the EXEC() and sp_executesql is that the former takes SQL statement in a string as parameter. But in case of the latter, it is a system procedure whose first parameter is a parameterized SQL statement. The second parameter is a parameter-list declaration, similar to the parameter list present in the declaration of a stored procedure. And the remaining are simply the parameters in that parameter-list. So the query built using this method is always same whenever it gets called but the user input changes which will be supplied at runtime.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/database-support/5030-difference-between-exec-sp_executesql-sql-server.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 01-20-2008 08:28 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Server.Transfer and Response.Redirect Arun ASP and ASP.NET Programming 4 09-19-2007 10:52 PM
What is the difference between UNION and UNIONALL in SQL Server? bluesky Database Support 1 07-25-2007 05:53 AM
Difference in for & foreach, exec vadivelanvaidyanathan Perl 0 07-15-2007 07:16 PM
Difference between Web Services and Client Server Environment vigneshgets Software Testing 1 05-17-2007 05:09 AM
Difference between Client-Server & Web Testing vadivelanvaidyanathan Software Testing 0 03-14-2007 05:51 AM


All times are GMT -7. The time now is 04:35 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0