diff --git a/SQLTools.sublime-settings b/SQLTools.sublime-settings index ffc57c5..154adac 100644 --- a/SQLTools.sublime-settings +++ b/SQLTools.sublime-settings @@ -37,6 +37,7 @@ "mysql" : "mysql", "pgsql" : "psql", "oracle" : "sqlplus", + "mssql" : "sqlcmd", "vertica" : "vsql", "sqsh" : "sqsh", "firebird": "isql", @@ -185,6 +186,30 @@ } } }, + "mssql": { + "options": [], + "before": [], + "args": "-d \"{database}\"", + "args_optional": ["-S \"{host},{port}\"", "-S \"{host}\\{instance}\"", "-U \"{username}\"", "-P \"{password}\""], + "queries": { + "desc": { + "query": "set nocount on; select concat(table_schema, '.', table_name) from information_schema.tables order by table_name;", + "options": ["-h", "-1"] + }, + "columns": { + "query": "set nocount on; select concat(table_name, '.', column_name) from information_schema.columns order by table_name, ordinal_position;", + "options": ["-h", "-1"] + }, + "desc table": { + "query": "exec sp_help \"%s\";", + "options": [] + }, + "show records": { + "query": "select top {1} * from {0};", + "options": [] + } + } + }, "vertica": { "options": [], "before" : [], diff --git a/SQLToolsConnections.sublime-settings b/SQLToolsConnections.sublime-settings index 718df4d..f5fc3ed 100644 --- a/SQLToolsConnections.sublime-settings +++ b/SQLToolsConnections.sublime-settings @@ -42,6 +42,19 @@ "service" : "servicename", "encoding": "utf-8" }, + "Connection MSSQL": { + "type" : "mssql", + // use either ("host", "port") and remove "instance" + // or ("host", "instance") and remove "port" + "host" : "localhost", + "instance": "SQLEXPRESS", + // "port" : 1433, + // "username" and "password" are optional (remove if not needed) + "username": "sa", + "password": "password", + "database": "sample", + "encoding": "utf-8" + } "Connection SQLite": { "type" : "sqlite", "database": "d:/sqlite/sample_db/chinook.db", // note the forward slashes in path