unofficial mirror of
 help / color / mirror / Atom feed
From: Evan Misshula <>
Subject: [SQL Mode and MS-SQL and Free TDS]
Date: Thu, 25 Jan 2024 01:41:01 -0500	[thread overview]
Message-ID: <> (raw)

Hi Mr. Mauger,

Thank you for your work maintaining and improving SQL-Mode. In customizing
it to work for me. I changed several  items and wanted to make those
changes available to the wider community.

1. I used Free-TDS ( FreeTDS is a set of
libraries for Unix and Linux that allows your programs to natively talk to
Microsoft SQL Server and Sybase databases. My employer uses MS SqlServer.

2. To get this to work, I had to change to functions. The first was to drop
"-D" parameter which has been deprecated by osql.  My version of
sql-comint-ms appears below.

(defun sql-comint-ms (product options &optional buf-name)
  "Create comint buffer and connect to Microsoft SQL Server."
  ;; Put all parameters to the program (if defined) in a list and call
  ;; make-comint.
  (let ((params
          (if (not (string= "" sql-user))
              (list "-U" sql-user))
;;          (if (not (string= "" sql-database))
;;              (list "-D" sql-database))
          (if (not (string= "" sql-server))
              (list "-S" sql-server))
    (setq params
          (if (not (string= "" sql-password))
              `("-P" ,sql-password ,@params)
            (if (string= "" sql-user)
                ;; If neither user nor password is provided, use system
                ;; credentials.
                `("-E" ,@params)
              ;; If -P is passed to ISQL as the last argument without a
              ;; password, it's considered null.
              `(,@params "-P"))))
    (sql-comint product params buf-name)))

osql no longer supports the "-w" parameter and sql-ms-options appears below

(defcustom sql-ms-options '(" " " " " ")
  ;; -w is the linesize
  "List of additional options for `sql-ms-program'."
  :type '(repeat string)
  :version "22.1")

Thank you for your consideration. If you like these changes I can prepare a
pull request to support Free-TDS and another to update ms for changes to

Evan Misshula

                 reply	other threads:[~2024-01-25  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).