Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Management Studio Express opening SQL scripts in Notepad

When I go to File > Open > File and select a .sql script, or even when I drag a .sql file into the SQL Management Studio Express window, it opens the script in Notepad which is totally useless when I want to run the script.

Since this is on an external server (Windows 2003 Server), I end up having to disconnect from RDP, disable the local clipboard, re-connect and then copy-paste the script's contents from Textpad in order to run it.

I've checked the options menus but can't see anything relating to Notepad, not even in the "external tools" section. Any ideas why it would be doing this?

Please note: I have checked the file association for SQL scripts and it is set to SQL Management Studio Express.

like image 813
tags2k Avatar asked Jul 10 '09 13:07

tags2k


People also ask

How do I run a SQL script from Notepad?

cmd /k c:\path\to\sqlclient.exe $(FILE_NAME) It will open a new cmd.exe Windows command prompt, and show the output from that file. If instead of running, you hit “SAVE”, you can give it a name (which will end up later in the Run menu), and/or a keyboard shortcut, so that you can easily re-use that many times.

Can you open a .SQL in Notepad?

Files with the . SQL extension are Structured Query Language (SQL) data files, which are used to access and modify relational databases. To quickly view or edit SQL file, you can open it in a text editor like Notepad or TextEdit.

How do I open a SQL script file?

Design a new query or open an existing one in SQL Server Manager Studio. Click Query > Connection > Connect to connect to the server that contains the database you want to access. Select the appropriate StarTeam Server database. Open the tuning script, by choosing File > Open > foldername\scriptname.

How do I open a script in SQL Server Management Studio?

In Microsoft SQL Server Management Studio, on the menu, select File > Open > File. In the Open File dialog box, browse for the script file, and then click OK.


1 Answers

Ran into this this morning. Turned out to be an encoding issue for me. I opened the script up in UltraEdit and I noticed that it was showing the encoding to be U-DOS instead of DOS. I ran the Unicode to ASCII conversion (also in UltraEdit), saved the file, and now Management Studio is opening up the files correctly.

like image 130
NFrank Avatar answered Oct 12 '22 16:10

NFrank