title: Update data from table database SQL Server through Shiny app
body: <p>I want to develop an app with shiny and I have just started with R(so you can imagine...).</p>
  
  <p>Right now I managed to connect my shiny app to Microsoft SQL Server(through DBI library) and show one of the 3 tables I have on this database.</p>
  
  <p>The goal is to allow the user to click on the rows and change data on it. In this case only one column which takes only 1 or 0 as values. I managed to create the button but I am not able to allow the app to let me click on the row and change the data.</p>
  
  <p>Here is the code I have so far:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code># Load libraries
  library(shiny)
  library(shinydashboard)
  library(RODBC)
  library(odbc)
  library(pool)
  library(DBI)
  
  
  # connect database
  con = DBI::dbConnect(odbc::odbc(), 
                       Driver = "SQL Server", 
                       Server = "MyServer", 
                       Database = "test", 
                       Trusted_Connection = "True")
  
  
  # Start the dashboard
  ui = dashboardPage(
    dashboardHeader(title = 'My_first_App'),
    
    dashboardSidebar(
      sidebarMenu(
        menuItem("Tables", tabName = "tables", icon = icon("th")),
        menuItem("Perfomance Dashboard", tabName = "dashboard", icon = icon("dashboard"))
      )
    ),
    
    dashboardBody(
      tabItems(
        # item for tables(Table_1 in this case)
        tabItem(tabName = "tables",
                fluidRow(
                  box(tableOutput("tbl")),
  
                  # Tick box to allow the user to change data
                  box(title = "Column_to_change",
                      checkboxInput("Column_to_change", "Column_to_change", FALSE)),
                  
                  #action buttons
                  actionButton("submit", "Submit"),
                  actionButton("new", "New")
                ))
      )
    )
  )
  
  
  server = function(input, output) {
    
    # We get the Table_1 to show all of it
    output$tbl = renderTable({
      sql = "SELECT * FROM Table_1;"
      query = sqlInterpolate(con, sql, id = input$ID)
      dbGetQuery(con, query)
      
    })
    
    
  }
  
  shinyApp(ui, server)</code></pre>
  </div>
  </div>
  </p>