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

Commit b5d23d7

Browse files
authored
Merge pull request #135 from mtxr/feature/mssql-support
Add MSSQL support by using native sqlcmd CLI Merged manually because a codacy bug was blocking PR.
2 parents d16e355 + db7aff2 commit b5d23d7

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

SQLTools.sublime-settings

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"mysql" : "mysql",
3838
"pgsql" : "psql",
3939
"oracle" : "sqlplus",
40+
"mssql" : "sqlcmd",
4041
"vertica" : "vsql",
4142
"sqsh" : "sqsh",
4243
"firebird": "isql",
@@ -185,6 +186,30 @@
185186
}
186187
}
187188
},
189+
"mssql": {
190+
"options": [],
191+
"before": [],
192+
"args": "-d \"{database}\"",
193+
"args_optional": ["-S \"{host},{port}\"", "-S \"{host}\\{instance}\"", "-U \"{username}\"", "-P \"{password}\""],
194+
"queries": {
195+
"desc": {
196+
"query": "set nocount on; select concat(table_schema, '.', table_name) from information_schema.tables order by table_name;",
197+
"options": ["-h", "-1"]
198+
},
199+
"columns": {
200+
"query": "set nocount on; select concat(table_name, '.', column_name) from information_schema.columns order by table_name, ordinal_position;",
201+
"options": ["-h", "-1"]
202+
},
203+
"desc table": {
204+
"query": "exec sp_help \"%s\";",
205+
"options": []
206+
},
207+
"show records": {
208+
"query": "select top {1} * from {0};",
209+
"options": []
210+
}
211+
}
212+
},
188213
"vertica": {
189214
"options": [],
190215
"before" : [],

SQLToolsConnections.sublime-settings

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@
4242
"service" : "servicename",
4343
"encoding": "utf-8"
4444
},
45+
"Connection MSSQL": {
46+
"type" : "mssql",
47+
// use either ("host", "port") and remove "instance"
48+
// or ("host", "instance") and remove "port"
49+
"host" : "localhost",
50+
"instance": "SQLEXPRESS",
51+
// "port" : 1433,
52+
// "username" and "password" are optional (remove if not needed)
53+
"username": "sa",
54+
"password": "password",
55+
"database": "sample",
56+
"encoding": "utf-8"
57+
},
4558
"Connection SQLite": {
4659
"type" : "sqlite",
4760
"database": "d:/sqlite/sample_db/chinook.db", // note the forward slashes in path

0 commit comments

Comments
 (0)