Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:20+00:00 2026-05-29T09:12:20+00:00

Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database

  • 0

Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database using sqsh instead of isql. I added the following to my initi.el

(set 'sql-sybase-program "sqsh")
(set 'sql-ms-program "sqsh")

It recompiles and loads successfully. However, when I use sql-ms and try to connect to the database, I am getting errors because emacs is using lower-case command parameters when it should be using upper-case command parameters. Furthermore, I can successfully connect to the database server using sqsh from the command line. When I try to run things within emacs, I get the following error:

sqsh: -d: Invalid integer expression

Process SQL exited abnormally with code 255

I did a pretty extensive Google search and I can’t find much on how to do this (which makes me think it may not be possible). Obviously, I can run sqsh from within a shell, but then I lose the SQL mode integration. I’m not sure what I can / need to do to my init.el file to make this possible.

I think all I really need to do is figure out how to get emacs to send a -D not a -d to sqsh. Apparently isql doesn’t care, but sqsh cares deeply about the difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:12:21+00:00Added an answer on May 29, 2026 at 9:12 am

    As you say, the real answer is to get Emacs to use -D instead of -d. However, as a workaround, running sql-sybase instead of sql-ms seems to work fine for me.

    Update: Try this code, it removes the -n option from sql-ms-options and redefines sql-ms-options to use -D instead of -d as the option to select the database:

    (setq sql-ms-options (remove "-n" sql-ms-options))
    
    (defun sql-comint-ms (product options)
      "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 options))
        (if (not (string= "" sql-server))
            (setq params (append (list "-S" sql-server) params)))
        (if (not (string= "" sql-database))
            (setq params (append (list "-D" sql-database) params)))
        (if (not (string= "" sql-user))
        (setq params (append (list "-U" sql-user) params)))
        (if (not (string= "" sql-password))
        (setq params (append (list "-P" sql-password) params))
          (if (string= "" sql-user)
          ;; if neither user nor password is provided, use system
          ;; credentials.
          (setq params (append (list "-E") params))
        ;; If -P is passed to ISQL as the last argument without a
        ;; password, it's considered null.
        (setq params (append params (list "-P")))))
        (sql-comint product params)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using emacs in Ubuntu. How can I remap META to the ALT
I'm using Emacs, with CLISP and Slime, and want to be able to draw
I've been using Emacs for a couple months now, and I want to get
I'm using Emacs with clojure mode and slime connected to a swank server produced
I installed Ubuntu 10.04, and with it came Emacs 23. If I want to
I am using emacs 23.2 on Ubuntu 10.04 & Windows XP along with cedet
Basically I am using emacs on remote server (my school) but when I logged
I normally connect to another server using the terminal using: ssh username@xx.xx.xx.xx However, I
I am using emacs 22.2.1 on Ubuntu 9.04. Every time I open a file
I am using emacs 22.2.1 and Ubuntu 9.04 I have done this in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.