0

I'm going to make a batch script to do some basic troubleshooting. Among other things, I want to test 32-bit MySQL ODBC's for connectivity. This script will run locally on each workstation. There doesnt appear to be any option in odbcconf.exe for this.

Ken Ash
  • 11
  • 1
  • Maybe see http://serverfault.com/questions/450557/migrating-odbc-information-through-a-batch-file/451009#451009 – Ryan Ries Feb 20 '15 at 22:34
  • Not quite what i'm looking for. I simply want to test the connection, not create a new odbc. – Ken Ash Mar 27 '15 at 20:11

1 Answers1

0

Something like:

sqlcmd.exe -U MyLogin -P MyPassword -S ComputerName\InstanceName | find "connected"

If the connection succeeds, then you know your ODBC connection is good.

Also, check out this big article on scripting with sqlcmd:

https://msdn.microsoft.com/en-us/library/ms188714.aspx

Ryan Ries
  • 55,481
  • 10
  • 142
  • 199