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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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. |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |