Top "Sp-executesql" questions

sp_executesql is a system stored procedure in Microsoft's SQL Server product range (2005 onwards) for running dynamic SQL.

EXEC sp_executesql with multiple parameters

How to pass the parameters to the EXEC sp_executesql statement correctly? This is what I have now, but i'm …

sql-server tsql stored-procedures sp-executesql
Execute sp_executeSql for select...into #table but Can't Select out Temp Table Data

Was trying to select...into a temp Table #TempTable in sp_Executedsql. Not its successfully inserted or not but there …

sql sql-server-2008 tsql sp-executesql temp-tables
Pass a TABLE variable to sp_executesql

I'm trying to pass a TABLE variable to the sp_executesql procedure: DECLARE @params NVARCHAR(MAX) SET @params = '@workingData …

sql dynamic sp-executesql
Is COMMIT required after every EXECUTE IMMEDIATE?

I have multiple EXECUTE IMMEDIATE commands within one oracle procedure. EXECUTE IMMEDIATE 'DELETE FROM tbl1'; EXECUTE IMMEDIATE 'INSERT INTO …

oracle stored-procedures oracle11g sp-executesql executequery
Workaround for calling table-valued function remotely in SQL Server has even more issues

I had a query with a set of parameters that needed to be run multiple times with different parameters, so …

sql-server-2008 permissions linked-server openquery sp-executesql
sp_executesql and table output

I'm writing a stored procedure in SQL Server 2005, at given point I need to execute another stored procedure. This invocation …

sql sql-server-2005 sp-executesql
Dynamic query results into a temp table or table variable

I have a stored procedure that uses sp_executesql to generate a result set, the number of columns in the …

sql-server dynamic-sql temp-tables table-variable sp-executesql
Execute a SQL String and insert result into table

I have a table DECLARE @Results TABLE(QueryIndex smallint, FieldValue nvarchar(50)) QueryIndex is a loop counter, it will get value …

sql-server sp-executesql
Specify the parameter values part of sp_executeSQL as a parameter

I am using SQL Server 2008 R2. I need to use a parameter for the last part of T-SQL below. In …

sql-server-2008-r2 sp-executesql
Permissions when using "Execute sp_Executesql"

I have a database where all access is controlled by stored procedures. The DBA would like to avoid giving users …

sql sql-server permissions dynamic-sql sp-executesql