Slack and MSSql Query run

Is it possible to run a pre-configured query on MS SQL Server via Slack message?

When I send a message in a specific channel like “run sql” is it possible to slack run a query on my MS SQL Server and return data?

  • Getting the sum of two select count statements
  • Maintaining audit log for entities split across multiple tables
  • How does alter table switch works on sql server?
  • sql use while loop to fetch values and run query on them
  • PreparedStatement - how specify to use default value of column
  • SQL and Java return different dates?
  • I did this on my iOS app via sql.client 3rd party addon but can’t figure it out on slack. Thank you!

    (no problem to use 3rd party api or add-ons)

    2 Solutions collect form web for “Slack and MSSql Query run”

    Not with vanilla Slack but if you integrate a “bot” alongside the SqlServerSlackAPI custom integration you can add custom functionality like you are after.

    Bot’s like Hubot or mmbot will provide the mechanism to write scripts that respond to certain commands or phrases.

    I’m currently using mmbot and the SqlServerSlackAPI addon to write custom alerts and commands for monitoring some internal systems with the ability to send commands to Slack to get updates on the status of certain services. Slack fires off a command to a script running in mmbot which triggers a sql procedure to run a query and return results back to Slack which displays this as a message.

    If you want something out of the box, check out, it’s a slackbot for running SQL queries in slack. It works with any SQL database, including MS SQL. After you add to slack and integrate your database, you’ll be able to type SQL in a direct message to the bot, and get data back in Slack. You can save, label, an schedule queries, and export to csv also.

    The bot is a hosted solution with two 3rd parties ( and Slack), and you will need to provide credentials to your database when integrating for the first time (done via conversation with the bot). This might not be for you if you’re wary of third party access to your database, but it sounds like you aren’t.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.