declare @stmt nvarchar(max), @params nvarchar(max); exec sp_get_query_template N'select * from tableA where col1 = 200', @stmt output, @params output; exec sp_create_plan_guide N'TemplateGuide', @stmt, N'template', NULL, @params, N'option(parameterization forced)';