Skip to content Skip to sidebar Skip to footer
Showing posts with the label Sp Executesql

How To Use Sp_executesql To Avoid Sql Injection

In the below sample code, Table Name is an input parameter. In this case, how can I avoid SQL injec… Read more How To Use Sp_executesql To Avoid Sql Injection

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 i… Read more Dynamic Query Results Into A Temp Table Or Table Variable

Performance Differences Calling Sp_executesql With Dynamic Sql Vs Parameters

Given: CREATE PROCEDURE [dbo].[my_storedproc] @param1 int, @param2 varchar(100) AS > GO Are … Read more Performance Differences Calling Sp_executesql With Dynamic Sql Vs Parameters

How Do I Truncate A Table Via Linked Server Using A Synonym For The Table Name?

I know I can do the following: EXEC Server_Name.DBName.sys.sp_executesql N'TRUNCATE TABLE dbo.t… Read more How Do I Truncate A Table Via Linked Server Using A Synonym For The Table Name?

Fully Qualified Table Names With Sp_executesql To Access Remote Server

Trying to update a table on a linked server (SQL 2000/2005) but my server name will not be known ah… Read more Fully Qualified Table Names With Sp_executesql To Access Remote Server