title: How to write a parametrized query in management studio?
body: <p>From a client application I tyipically do:</p>
  
  <pre><code>select * from table where Name = :Parameter
  </code></pre>
  
  <p>and then before executing the query I do</p>
  
  <pre><code>:Parameter = 'John'
  </code></pre>
  
  <p>These parameters are not a Search&amp;Replace but real parameters passed to the server. Since I need to test some of those queries in detail, how can I write the query in management studio?</p>
  
  <p>I want to write the query with parameters and give a value to the parameter. How can this be done?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>To remove confusion here I add info to better express myseld.</p>
  
  <p>when I execute a normal query I see in sql server profiler</p>
  
  <pre><code>select * from table where Name = 'John'
  </code></pre>
  
  <p>while when I execute a parametrized query I see this:</p>
  
  <pre><code>exec sp_executesql N'select * from table 
  where Name = @P1',N'@P1 varchar(8000)','John'
  </code></pre>
  
  <p>This is why I say it is not a search and replace.</p>