title: SQL SELECT query output with specific format
body: <p>I need, if possible, a T-SQL query that will return the values in a specific format from the columns. </p>
  
  <p>I can do this programmatically (c#), but is it possible to do in query using SQL Server 2008 ?</p>
  
  <p>Here's the current query</p>
  
  <pre><code>select id, server_name, domain_name 
  from mastertable
  </code></pre>
  
  <p>Current output:</p>
  
  <pre><code>id server_name   domanin_name
  1  sys1          one.abc.in
  2  sys2          two.pqr.in 
  3  sys3          three.abc.in 
  4  sys4          four.xyz.in
  </code></pre>
  
  <p>I need to display data as (skip value after (.) for column domain_name):</p>
  
  <pre><code>id server_name domanin_name
  1  sys1        one
  2  sys2        two
  3  sys3        three 
  4  sys4        four
  </code></pre>
  
  <p>Thanks in advance </p>