freetds

Connecting to SQL Server on Linux: tsql works; isql cannot log in

你离开我真会死。 提交于 2020-01-05 08:51:26
问题 I am trying to set-up a connection to a SQL server instance using Linux. My FreeTDS setup seems to work, but my unixODBC set-up does not. Here is what happens when I access the database with tsql: tsql -S STCONNSQLDEV\\RscSwitchboard -U sa_RSCSWITCHBOARD -P password locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" Here is what happens when I use isql: isql RscSwitchboard sa_RSCSWITCHBOARD password -v [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to

Bash script makes connection using FreeTDS, interacts, doesn't exit (just hangs)

£可爱£侵袭症+ 提交于 2020-01-04 01:57:05
问题 I'm using FreeTDS in a script to insert records into a MSSQL database. The USE and INSERT commands work, but the exit command doesn't and it hangs. I've tried redirecting stdout but cat complains. I suppose I will use Expect otherwise. Meh. Thanks. echo -e "USE db\nGO\nINSERT INTO db_table (id, data, meta)\nVALUES (1, 'data', 'meta')\nGO\nexit" > tempfile cat tempfile - | tsql -H 10.10.10.10 -p 1433 -U user -P pass 回答1: Did you mean to do this: cat tempfile - ? It means that it will wait for

FreeTDS and nvarchar(max) data

给你一囗甜甜゛ 提交于 2020-01-03 03:58:06
问题 I use a php application for managing a Microsoft SQL Server Database. The application is installed to unix and uses FreeTDS. While I do not have any problem to read / write data for nvarchar(n), I cannot handle correctly nvarchar(max) data for UTF-8. Configuration file for freetds: host = x port = 1433 tds version = 7.0 client charset = UTF-8 Is there any other option for freetds in order to handle correclty nvarchar(max) data? Thanks! 回答1: You need TDS 7.2, which adds support for SQL Server

One of the SELECT fails using unixOdbc - SQLSTATE[24000]: Invalid cursor state

这一生的挚爱 提交于 2020-01-02 03:17:31
问题 I am running Ubuntu 13.10 with FreeTDS and ODBC (package: php5-odbc) installed. I use tds version = 8.0, but also tried tds version = 7.2. I am using PDO and this is my DSN: $dsn = sprintf('odbc:Driver=FreeTDS;Server=%s;Port=1433;Database=%s', DB_SQL_SERVERNAME, DB_DB_NAME); I connect to MSSQL instance and perform some INSERT/SELECT queries using transactions, however I can not figure out why this query fails: SELECT id FROM tblColumns WHERE siteID = 10063 AND typeID = 1000 AND extendedTypeID

How to connect to Azure SQL database from Django app on Linux VM

霸气de小男生 提交于 2020-01-01 15:05:13
问题 I searched tutorials or full explanations about using SQL Azure Database with Django application, that hosted on Linux VM. I changed database section of settings.py like this DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'azure_database_name', 'USER': 'user@server_name_like_wjrnvlwjrng3', 'PASSWORD': 'my_pass', 'HOST': 'server_name_like_wjrnvlwjrng3.database.windows.net', 'PORT': '1433', 'OPTIONS': { 'driver': 'FreeTDS', 'TDS_Version': '7.1', } } } I append [MyDb] host =

Error installing TinyTDS on OSX 10.6 via gem install tiny_tds

女生的网名这么多〃 提交于 2020-01-01 09:36:09
问题 I have been trying to install the TinyTDS gem on a Macbook with OSX 10.6. I was successful in installing Free TDS -- confirmed that it works via: tsql -H SERVER -p 1433 -U username. The error I'm getting from gem install tiny_tds is: Building native extensions. This could take a while... ERROR: Error installing tiny_tds: ERROR: Failed to build gem native extension. /Users/jason/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for iconv_open() in iconv.h... no checking for iconv_open()

Querying MSSQL server 2012 from a Raspberry Pi 3 using Python, FreeTDS and pyodbc

限于喜欢 提交于 2019-12-30 10:52:53
问题 I am trying to query MSSQL server 2012 using Python as my scripting language on a raspberry Pi3. I have the need to create an application that will query MSSQL server and return some values that need to be displayed on a H.M.I. I chose the Raspberry Pi platform to develop this solution using Python as the programming language. I created the script using PyCharm on a Windows 7 PC and all worked well. When I moved it to the Raspberry Platform it didn't work. I am using pyODBC to do the

freeTDS not using its config

北战南征 提交于 2019-12-28 03:38:06
问题 I've decided to use FreeTDS driver and unixODBC to manage the PDO connection between my LAMP-based app with a remote MsSQL database. unfortunately it appears that the driver doesn't read the freetds.conf file, nor the environmental variables set either directly via server's CLI or specified in php file by putenv() function. now some data: as I ping the server - no packets are lost. as I telnet the server on 1433 port - the connection is established as I use the command TDSVER=7.0 tsql -H >IP<

How to run a SQL script in tsql

落花浮王杯 提交于 2019-12-25 06:04:02
问题 I'm using tsql (installed with FreeTDS) and I'm wondering if there's a way to run a SQL script in tsql from the command line and get the result in a text file. For example, in psql I can do: psql -U username -C "COPY 'SELECT * FROM some_table' to 'out.csv' with csv header" Or: psql -U username -C "\i script.sql" And in script.sql do: \o out.csv SELECT * FROM some_table; Is there a way for doing this in tsql? I have read the linux man page and search everywhere but I just don't find a way. 回答1

How to run a SQL script in tsql

為{幸葍}努か 提交于 2019-12-25 06:02:30
问题 I'm using tsql (installed with FreeTDS) and I'm wondering if there's a way to run a SQL script in tsql from the command line and get the result in a text file. For example, in psql I can do: psql -U username -C "COPY 'SELECT * FROM some_table' to 'out.csv' with csv header" Or: psql -U username -C "\i script.sql" And in script.sql do: \o out.csv SELECT * FROM some_table; Is there a way for doing this in tsql? I have read the linux man page and search everywhere but I just don't find a way. 回答1