Microsoft SQL Server in Sublime Text 2?

I am a sublime lover of text, but in my work I am forced to use Microsoft Visual Studio along with Microsoft SQL Server. I want to maybe just use sublime as I am familiar with it and my workflow is much better. For this I will need to know how to run SQL queries in sublime text? I am doing some research and found a couple of assemblies, but none of them work, so I am wondering if this is possible if this is the case?

+3


source to share


3 answers


It is difficult to create a complex IDE from ST2 due to the ascetic API.
Even the OracleSQL package does not provide features for PL/SQL Developer

or Toad

for Oracle.

So, it might be better to join SQLMS

with help ST

. For example, write in ST, but run, debug and edit in SQLMS.

Here is my setup for using ST and SQLMS together.



  • Setting up ST to automatically re-read file changes if saved file
  • Configuring SQLMS to automatically re-read file changes if a file is saved
  • External Tool Setting - "Open in Sublime Text" in SQLMS and bind it to ctrl+o,ctrl+s


    command: C:\Portable\Sublime Text 2\sublime_text.exe


    args: $(ItemPath):$(CurLine):$(CurCol)


    dir: $(ItemDir)

  • Install improved syntax "SQL Ex.tmLanguage"

    from here

Once configured, you can open the same file in ST and SQLMS and easily switch between editors.

+4


source


Late, but he was just trying to do the same.

A very crude solution I just tested in ST3 uses the following (you need to create a new Build system in ST and then link it to your SQL file)

{
    "cmd": ["sqlcmd", "-E", "-i", "$file"]
}

      



It uses a reliable SQL connection and assumes that the sql script will either run as-is on the default database, since the "USE" statement or table names are otherwise fully qualified.

For additional configuration run sqlcmd /?

from command line or read here

+1


source


TSQL Easy is a package that you can download that has some tools to run TSQL and SQL scripts. It also has nice TSQL syntax highlighting in sublime text 2. In fact, this is the only TSQL syntax highlighting I have found so far.

You can get the package here (or through package management): https://github.com/tosher/TSQLEasy

0


source







All Articles