Skip to content

Instantly share code, notes, and snippets.

@aevdokimenko
Created October 1, 2018 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aevdokimenko/3e63ced8b4bc4ccd953a57a6bd030667 to your computer and use it in GitHub Desktop.
Save aevdokimenko/3e63ced8b4bc4ccd953a57a6bd030667 to your computer and use it in GitHub Desktop.
Create proc [dbo].[sp_executequotedsql]
@sql nvarchar(max),
@debug int = 0
as
begin
select @sql = replace(replace(@sql, '"', ''''''), '`', '''')
if @debug = 1 print @sql
exec sp_executesql @sql
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment