1.

Which of the following is a calling syntax for sp_executesql?(a) sp_execute [,, …](b) sp_sql [,, …](c) sp_executesql [,, …](d) sp_executesql [,, …]I had been asked this question by my college director while I was bunking the class.This is a very interesting question from Dynamic SQL topic in division Developing with SQL Server of SQL Server

Answer»

The correct answer is (c) sp_executesql <@stmt> [<@param1 data_type>,<@param2 data_type>, …]

For explanation I would say: Using sp_executesql to run DYNAMIC statements GIVES us a COUPLE ADVANTAGES over EXEC that are worth noting.



Discussion

No Comment Found

Related InterviewSolutions