There is no editor available for script.sql?

I had a bizarre error this morning. The good news is that it had a simple solution in the end…

I have been editing a script file to install a default version of a database for a software product. I exported the database schema, data and indexes using SQL Management Studio and edited the resulting script file in TextPad.

I saved the file, but when I tried to test it in Sql Management Studio, it gave me the error message “There is no editor available for script.sql”. Eh?

I checked in explorer, and the “script.sql” file did indeed have the database script icon next to it. Just to be sure, I right clicked on it, chose “open with” and set the default program to “Sql Management Studio”. Sql Management Studio opened ad I still got “There is no editor available for script.sql”. Eh? Eh?

After much head scratching, tearing out of remaining hair and a bit of  Googling, I came up with the answer:  The file was saved in UNICODE rather than ANSI format.

I reopened the file in TextPad, chose “Save As”, chose “ANSI” for Encoding and overwrote the file. Sorted. Sql Management Studio was now happy with the file.

Going through the export process again, I now realise that there is a choice between Unicode and ANSI in the export. And guess what – Unicode is the default, ie “work=no”.

You’d at least have thought that the error message in this situation would be a bit better, given the Unicode default. A slightly more intelligent error message would have prevented a lot of wasted time.  Note quite up there with “Keyboard not detected – press F1 to continue”, but still…

Bookmark the permalink.

2 Responses to There is no editor available for script.sql?

  1. Joy says:

    thanks man… i was stuck with this problem until i got ur solution

  2. Libby says:

    Thanks so much! I was scratching my head too before I found your resolution.

Leave a Reply

Your email address will not be published. Required fields are marked *