The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
37 views

Capturing sp_executesql statement in sql profiler

After catching some data in a SQL Profiler session, I can almost always see a second entry of type RPC:Completed for each query using a sp_executesql statement. I know that this is done to create ...
1
vote
0answers
62 views

Trigger failing when called using sp_executesql

We have a recursive trigger on a table that executes AFTER INSERT. There is a check to ensure the trigger does not recurse more than 32 levels deep: IF(SELECT TRIGGER_NESTLEVEL()) >= 31 ...
0
votes
0answers
72 views

MSSQL - GRANT EXECUTE permission inside stored procedure

Environment SQL Server 2012 (11.0.2100.60) Situation user is allowed to execute a number of stored procedure; user is readonly denywrite one of stored procedure has an EXECUTE statement; The ...
0
votes
1answer
259 views

EXEC Multiple procedures in parallel?

SQL Server 2008. I have several stored procedures. I would like to execute them all in parallel, not serially. How can I do this?
0
votes
0answers
223 views

Problem with EXEC MyLinkedServer…sp_executesql within transaction

I rather clueless about this so any help is appreciated. We have got a stored procedure that is running within a transaction. The stored procedure is called from a .NET program (via normal ADO.NET). ...
9
votes
2answers
2k views

When does sp_executesql refresh the query plan?

You'll have to forgive my naivety as I'm not a DBA but my understanding is that over time the statistics of a database change and a stored procedure must be recompiled to keep the query plan up to ...
3
votes
2answers
1k views

sp_executesql adds statements to executed dynamic script?

The Question: As far as I can tell, sp_executesql adds statements to the beginning of submitted dynamic SQL script. But, a SQL Profiler trace does not capture the extra statements, and neither does ...