DSN-less connection to MS SQL with Windows Authentication - sql-server

I'm looking for a way to connect from a Linux server, to MS SQL Server. I was able to do so in a variety of ways but I want the connection to be DSN-less, uses Windows Authentication and preferably for Perl. I know ADO can do so but I don't think it's available on Linux.
What are my options?

There are various commercial ODBC drivers for Linux and one free solution I know of.
The Easysoft SQL Server ODBC Driver certainly provides windows authentication and DNS-less connections using a connection string like "DRIVER={Easysoft ODBC-Access Driver};Server=myserver;Port=myport;USER=mydomain\myusername;Password=mypassword".
There are a few other commercial ODBC Drivers from Openlink and DataDirect but I have no experience with either of them.
There is also freeTDS which is open source and can probably do windows authentication but here again, I've not personally tried windows authentication with it.
As for Perl you need the DBI and DBD::ODBC modules to use the solutions above. There are other solutions I found listed here. I maintain DBD::ODBC so I can obviously vouch for that working and I do all my testing with the Easysoft driver.
BTW, just so you know, I am affiliated with Easysoft and the web site link to the martin-evans domain is mine.

Related

How can I connect to SQL Server directly from Android with an C++ Builder FMX application

I get the following error when I try to connect to SQL Server directly with a C++Builder 10.2 Tokyo application. I couldn't locate the library requested despite all my searching.
Can anyone help? I'm at a crossroad to decide to continue with C++Builder or Xamarin.
Do you have C++ Builder Enterprise or Architect edition? You need this to connect to SQL Server using FireDAC. C++ Builder Professional edition can only connect to local databases.
Looking at this page:
Embarcadero Microsoft SQL interface
suggests to me that Microsoft SQL with Android client is not supported.
FDConnection is FMX compatible, but the drivers for various OSes are not.
There's a company called Devart that develops direct access connectivity for RAD studio mobile devices; Not sure if this will work if you only have C++ builder; but worth a try;
I'm currently in the same pickle and I'm busy writing a tcpclient/server proxy fmx app that will run on a windows server[where the mssql driver will work]
The idea is to connect from mobile device with tcp client to tcp server component running on windows and have that app grab the info i need for mobile app. Not the fastest solution in long run as you have to do all your authentication and encryption yourself and not the cheapest either as it requires an online windows server or pc... but if you already have it, you might as well use it.
Will update if it succeeds or fails

How to avoid ODBC driver installation for a Node.js application?

I'm using https://www.npmjs.org/package/odbc in an application targeting Windows.
Therefore it requires users to install Microsoft ODBC driver for SQL Server located here, which is a problem if the user doesn't have admin rights.
Any workaround?
You can use another system for databases, mongoDB, sqlite, etc. if your application is simply, i recommend sqlite

Connecting to SQL Server 2008 from a Mac

Office for Mac 2011 has better support for Pivot Tables in Excel, including external data.
I need an ODBC connection on a Mac to SQL Server 2008. Microsoft recommends using a JDBC driver, but the documentation for it is very, very, very weak.
Here is the link to the JDBC driver: http://msdn.microsoft.com/en-us/sqlserver/aa937724
Now, once that is downloaded and extracted, you can add the JDBC driver via the Apple ODBC Administrator.
.
Finally, you can add the ODBC connection, but it won't let me edit the keyword or values.
:
A few questions:
Am I using the right driver/do I have it installed correctly?
Is there a way to change the keyword values in the ODBC Administrator?
Thanks
Just to help those who stumble across this problem:
Control + Click to edit both Keyword and Value fields in Mac OS X ODBC Administrator.
Alternatively, Command + Return
Tab-bing through the fields work as well.
I'm not sure where you found the recommendation to use a JDBC driver with MS Office 2011. I am sure it won't work out.
However -- ODBC drivers for Mac do exist, for MS SQL Server and other DBMS, and these are fully compatible with MS Office 2011. My employer makes a number of these drivers.
For your specific need, I'd start here.
Good luck!
Edited to clarify: All versions of Microsoft Office are built with ODBC client capabilities. None have JDBC client capabilities. If you're to use Microsoft Office against an JDBC driver, you'll also need an ODBC Driver for JDBC Data Sources ... such as this one from my employer.

What are some ways of accessing Microsoft SQL Server from Linux?

We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows.
FreeTDS + unixODBC or iODBC
Install first FreeTDS, then configure one of the two ODBC engines to use FreeTDS as its ODBC driver. Then use the commandline interface of the ODBC engine.
unixODBC has isql, iODBC has iodbctest
You can also use your favorite programming language (I've successfully used Perl, C, Python and Ruby to connect to MSSQL)
I'm personally using FreeTDS + iODBC:
$more /etc/freetds/freetds.conf
[10.0.1.251]
host = 10.0.1.251
port = 1433
tds version = 8.0
$ more /etc/odbc.ini
[ACCT]
Driver = /usr/local/freetds/lib/libtdsodbc.so
Description = ODBC to SQLServer via FreeTDS
Trace = No
Servername = 10.0.1.251
Database = accounts_ver8
sql-cli is a nodejs based cross platform command line interface for sql server. You can install it via npm https://www.npmjs.org/package/sql-cli
It can connect to both on-premise and sql azure instance.
sqsh + freetds.
sqsh was primarily an isql replacement for Sybase SQL Server (now ASE) but it works just fine for connecting to SQL Server (provided you use freetds).
To compile, simply point $SYBASE to freetds install and it should work from there. I use it on my Mac all day.
The best part of sqsh are the advanced features, such as dead simple server linking (no need to set up linked servers in SQL Server), flow control and looping (no more concatenating strings and executing dynamic SQL), and invisible bulk copy/load.
Anyone who uses any other command line tool is simply crazy! :)
pymssql is a DB-API Python module, based on FreeTDS. It worked for me. Create some helper functions, if you need, and use it from Python shell.
Mono contains an ADO.NET provider that should do this for you. I don't know if there is a command line utility for it, but you could definitely wrap up some C# to do the queries if there isn't.
Have a look at http://www.mono-project.com/TDS_Providers and http://www.mono-project.com/SQLClient
Since November 2011 Microsoft provides their own SQL Server ODBC Driver for Linux for Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES).
Download Microsoft ODBC Driver 11 for SQL Server on Red Hat Linux
Download Microsoft ODBC Driver 11 for SQL Server on SUSE - CTP
ODBC Driver on Linux Documentation
It also includes sqlcmd for Linux.
If you are using Java, have a look at JDBC.
http://msdn.microsoft.com/en-us/library/ms378672(SQL.90).aspx
http://en.wikipedia.org/wiki/Jdbc
You don't say what you want to do with the resulting data, but if it's general queries for development/maintenance then I'd have thought Remote Desktop to the windows server and then using the actual SQL Server tools on their would always have been a more productive option over any hacked together solution on Linux itself.
There is an abstraction lib available for PHP. Not sure what your client's box will support but if its Linux then certainly should support building a PHP query interface with this:
http://adodb.sourceforge.net/ Hope that helps you.
I'd like to recommend Sqlectron. Besides being open source under MIT license it's multiplatform boosted by Electron. Its own definition is:
A simple and lightweight SQL client desktop with cross database and platform support
It currently supports PostgreSQL, MySQL, MS SQL Server, Cassandra and SQLite.
Surprised no one has mentioned that, contrary to what other answers seem to suggest, FreeTDS is all you need. No need for unixODBC, iODBC or anything else on top of it.
run some database queries [...] command-line utility similar to sqlcmd on Windows
tsql does this and is part of the FreeTDS package (as are freebcp and other utilities). tsql does not have fancy UI, but if you want a command-line utility that is light, functional and performant, it'll do just fine.
See e.g. How to run a SQL script in tsql
And by light, I mean under 500kb in size (maybe under 60k depending on how it's compiled) and, as far as I have seen, extremely efficient with memory and CPU.
I was not confortable with the freetds solution,
it's why i coded a class (command history, autocompletion on tables and fields, etc.)
http://www.phpclasses.org/package/8168-PHP-Use-ncurses-to-get-key-inputs-and-write-shell-text.html
valentina-db it has free version for sql server
.rpm and .deb
serial id will be sent by email after registration
https://www.valentina-db.com/en/
https://valentina-db.com/en/store/category/14-free-products
If you use eclipse you can install Data Tools Platform plugin on it and use it for every DB engines including MS SQLServer. It just needs to get JDBC driver for that DB engine.
There is a nice CLI based tool for accessing MSSQL databases now.
It's called mssql-cli and it's a bit similar to postgres' psql.
Gihub repository page
Install for example via pip (global installation, for a local one omit the sudo part):
sudo pip install mssql-cli

Connecting to an Oracle database on the command-line without using the Oracle client software?

I have access to an Oracle server that has some databases that I would like to access. However, the machine that I have access from has none of the oracle client software. Is there any alternative to oracle's client software the provides the functionality of something like MySQL's mysql or Postgres' psql? I'd like to be able to poke around a bit in the database before writing software against it.
If you download the free Oracle Instant Client you'd be able to use any JDBC or ODBC Database tool such as DbVisualizer or SquirrelSQL. Those are GUI tools; I've not come across a JDBC command line tool but there may be one out there.
Alternatively, there is an Instant Client version of SQL*Plus which will give you an Oracle sqlplus command line without a full Oracle install.
Oracle's free PL/SQL IDE SQL Developer can use Type 4 JDBC drivers to connect to a number of different types of databases, obviously including Oracle. You can use that without doing any sort of Oracle client install if you so desired.
You could try the Oracle IDE SQL Developer which is a free download. It is written in Java and is available for both windows and linux. It is self contained and doesn't require the Oracle client be installed.
SQLPal (http://www.sqlpal.com/) is a lightweight SqlPlus like application for Windows that does not require the oracle client.

Resources