title: Query with parameter with golang and sqlserver driver
body: <p>I'm trying to get a specific item by ID from my sql server database. Here's my code :</p>
  
  <pre><code>var(
      allArticlesQry string = "SELECT * FROM Articles"
      findArticlesQry string = "SELECT * FROM Articles WHERE Id = ?1"
  )
  
  func FindArticle(w http.ResponseWriter, r *http.Request){
      vars := mux.Vars(r)
      var id = vars["id"]
      var article Article
  
      db := connect()
      defer db.Close()
  
      stmt, err := db.Prepare(findArticlesQry)    
      if err != nil{
          log.Fatal(err)
      }
      defer stmt.Close()
  
      err = stmt.QueryRow(id).Scan(&amp;article.Title, &amp;article.Description, &amp;article.Body, &amp;article.Id)
      if err != nil{
          log.Fatal(err)
      }
  
      w.Header().Set("Content-Type", "application/json; charset=UTF-8")
      w.WriteHeader(http.StatusOK)
      json.NewEncoder(w).Encode(u.HttpResp{Status: 200, Body: article})
  }
  </code></pre>
  
  <p>I'm using <a href="https://github.com/denisenkom/go-mssqldb" rel="nofollow noreferrer">this package</a> for the sqlserver driver and it has this example who should work fine : <code>db.Query("SELECT * FROM t WHERE a = ?3, b = ?2, c = ?1", "x", "y", "z")</code> </p>
  
  <p>But everytime I try to call this function it fails and returns : 
  <code>2017/09/01 16:31:01 mssql: Incorrect syntax near '?'.</code></p>
  
  <p>So I don't really understand why my query doesn't work..</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried another way, I removed the part where I prepare the query before executing and now it doesn't crash my server, I have a response but the problem is still the same : </p>
  
  <pre><code>var row = db.QueryRow(findArticlesQry, id).Scan(&amp;article.Title, &amp;article.Description, &amp;article.Body, &amp;article.Id)
  </code></pre>
  
  <p>And the response : </p>
  
  <pre><code>{
      "status": 200,
      "description": "",
      "body": {
          "Number": 102,
          "State": 1,
          "Class": 15,
          "Message": "Incorrect syntax near '?'.",
          "ServerName": "DESKTOP-DLROBC4\\LOCALHOST",
          "ProcName": "",
          "LineNo": 1
      }
  }
  </code></pre>