From tekkies.co.uk
Jump to: navigation, search

Run OLE DB SQL/SQL Server query or command from the command line or from a batch file.


OLE DB Command Line SQL Query Execution v1.4.4269.35740
(C) 2011 Andrew Joiner http://tekkies.co.uk/go/runsqloledb
This software is provided "as is". Use at your own risk.
RunSQLOLEDB "[connection string]" "[query]"
RunSQLOLEDB "Provider=SQLOLEDB;Data Source=(local);..." "SELECT GetDate()"
RunSQLOLEDB @ConnectionString.txt @Query.sql

Download: http://tekkies.co.uk/download/RunSQLOLEDB.v1.4.zip

I use this to access Sybase Advantage databases, but I guess you can use it for mySQL, SqlServer, Oracle...

Other examples:

RunSQLOLEDB "Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=SSPI;" "SELECT GetDate()"