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 |
|
#1
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| system, exec, passthru - tried them all - now I'm at a loss | kenrojas1 | PHP Programming | 0 | 12-30-2008 07:56 AM |
| What is the difference between UNION and UNIONALL in SQL Server? | bluesky | Database Support | 1 | 07-25-2007 04:53 AM |
| What is the difference between Server.Transfer and Response.Redirect? Why would I cho | prasath | ASP and ASP.NET Programming | 1 | 07-19-2007 01:41 AM |
| Difference in for & foreach, exec | vadivelanvaidyanathan | Perl | 0 | 07-15-2007 06:16 PM |
| Difference between Client-Server & Web Testing | vadivelanvaidyanathan | Software Testing | 0 | 03-14-2007 04:51 AM |
Our Partners |