title: Remove column header from SQL Server query result
body: <p>I want to remove column header from SQL Server query output. I did the search but not found any solution. I have a query eg. </p>
  
  <pre><code>select cc.DepartmentID , cc.Name  from HumanResources.Department cc
  </code></pre>
  
  <p>When I run this query I am getting output like this.</p>
  
  <pre><code>ID  Name
  12  Document Control
  1   Engineering
  16  Executive
  14  Facilities and Maintenance
  10  Finance
  9   Human Resources
  </code></pre>
  
  <p>I want to remove ID and Name (Column Header) from the output in SQL Server.</p>
  
  <p>I will run this query by script to generate csv file.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>When i run the query by script i got the csv file as output and it look like this.</p>
  
  <pre><code>#TYPE System.Data.DataRow           
  ID  Name    
  </code></pre>
  
  <p><strong>Update:</strong> </p>
  
  <p>I am putting powershell script.</p>
  
  <pre><code>$Database = "temp"
  $Server = "localhost"
  
  $AttachmentPath = "output.csv"
  
  
  # Connect to SQL and query data, extract data to SQL Adapter
  
  $SqlQuery = "select cc.DepartmentID , cc.Name  from HumanResources.Department cc"
  $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
  $SqlConnection.ConnectionString = "Data Source=$Server;Initial Catalog=$Database;Integrated Security = True"
  $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
  $SqlCmd.CommandText = $SqlQuery
  $SqlCmd.Connection = $SqlConnection
  $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
  $SqlAdapter.SelectCommand = $SqlCmd
  $DataSet = New-Object System.Data.DataSet
  $nRecs = $SqlAdapter.Fill($DataSet)
  $nRecs | Out-Null
  
  #Populate Hash Table
  
  $objTable = $DataSet.Tables[0]
  
  #Export Hash Table to CSV File
  
  $objTable | Export-CSV $AttachmentPath
  </code></pre>
  
  <p>I want to remove column header from output.</p>