Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

MS SQL Server Support #52

Closed
jobe451 opened this issue Nov 15, 2016 · 4 comments
Closed

MS SQL Server Support #52

jobe451 opened this issue Nov 15, 2016 · 4 comments
Labels

Comments

@jobe451
Copy link

jobe451 commented Nov 15, 2016

I got SQLTools working with MS SQL Server, here is the definition I use. Maybe this could be added.

CLI-Definition:

    "cli" : {
        "mssql"   : "sqlcmd"
    },

Calling sqlcmd definition:

        "mssql": {
            "options": [],
            "before": [],
            "args": "-S \"{host}, {port}\" -U \"{username}\" -P \"{password}\" -d\"{database}\"",
            "queries": {
                "desc" : {
                    "query": "Select '| ' + Table_name + ' |' as tablenames From Information_schema.Tables Where Table_type = 'BASE TABLE' and Objectproperty (Object_id(Table_name), 'IsMsShipped') = 0",
                    "options": [],
                    "format" : "|%s|"
                },
                "desc table": {
                    "query": "SELECT ORDINAL_POSITION, cast(left(COLUMN_NAME,40) as varchar(40)) as COLUMN_NAME, cast(left(DATA_TYPE,20) as varchar(20)) as DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '%s'",
                    "options": [],
                    "format" : "|%s|"
                },
                "show records": {
                    "query": "select top 100 * from {0}",
                    "options": [],
                    "format" : "|%s|"
                }
            }
        },   
@llsousa
Copy link

llsousa commented Nov 30, 2016

"args": "-S \"{host}, {port}\" -U \"{username}\" -P \"{password}\" -d\"{database}\"",

@mtxr , in case the authentication is done by AD, there's no need to set username and password. Is there a way to define them as optional?
Or, the code that calls the command test first if the parameters are null and in case they are, don't consider them?

@mtxr
Copy link
Owner

mtxr commented Dec 5, 2016

@llsousa sure. You can set it on your user settings by removing "username" and "password" params.

@jobe451 what was the error before these changes?

@mtxr mtxr added the question label Dec 5, 2016
@mtxr mtxr closed this as completed Dec 10, 2016
@jobe451
Copy link
Author

jobe451 commented Dec 11, 2016

@mtxr: There was no definition for MSSQL, the definition above adds that.

@mkormendy
Copy link

mkormendy commented Feb 28, 2017

The settings definitions above do not work with:
https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/03/sql-server-command-line-tools-for-mac-preview-now-available/

@mkormendy mkormendy mentioned this issue Aug 29, 2017
4 tasks
tkopets added a commit that referenced this issue Aug 30, 2017
So far tested only on Windows.
Related to #120 #52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants