none
Error when I try to open SQL Server file (.sql) in Visual Studio 2015 editor

    Question

  • Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

    I get this error when ever I want to open a .sql file in Visual Studio 2015 Update 2. I have Sql Server 2014 installed on my system, but I still have this problem.

    For a workaround, I open .sql files as "Source Code (Text) Editor" for now, but it's not a real solution.

    How Can I fix this? Thanks in advance.


    Jalalx


    Thursday, September 22, 2016 7:47 AM

Answers

All replies

  • Hi Jalal Khordadi,

    According to your description, please refer to the following steps to troubleshoot this issue.

    1). Based on the error, VS2015 could not found 'Microsoft.SqlServer.BatchParser’ in your machine. Please check your computer whether has this dll. In my VS2015 Enterprise, I have not find the Microsoft.SqlServer.BatchParser in my VS2015. Please refer to the following screenshot:

    2). Please make sure the version of SQL Server is the same as your OS (32bits or 64bits).

    3). In my side I could open the .sql file without any problems, because it was exported by SQL Server 2014. Please make sure your .sql file was exported by VS2014 or later version.

    4). If we could not open the .sql file, we could change the suffix name to .txt file. Than open it in VS.

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Friday, September 23, 2016 5:19 AM
    Moderator
  • Except number 1, the other solutions doesn't apply here. I can run sql server without any problem. Also no matter how you export, it's simply a text file with .sql extension. So version mismatching is not apply here. Also as I said, changing extension doesn't make any change.

    I don't have access to the machine right now, I will check your first solution tomorrow.

    Thank you.


    Jalalx


    Friday, September 23, 2016 7:27 AM
  • Hi Jalalx,

    Thanks for your response.

    Could you open the .sql file with Notepad? And In which type project you need to open it.

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Friday, September 23, 2016 7:44 AM
    Moderator
  • Yes, I can open .sql files with notepad and inside Visual Studio when I open them as "Source Code (Text) Editor" mode but it doesn't have intellisense.

    I need to be able to open it in any WebForms or SQL Database project like before.


    Jalalx

    Sunday, September 25, 2016 6:16 AM
  • Also I can't find 'Microsoft.SqlServer.BatchParser’ in my machine. Is there any package or library that I have to install?SqlBatch


    Jalalx

    Sunday, September 25, 2016 6:25 AM
  • Hi Jalal,

    Thank you for your response.

    >>open them as "Source Code (Text) Editor" mode

    Could you please share me the method that how to open .sql file in Source Code (Text) Editor mode, which could help me to repro your issue in my side.

    In my side, I could import .sql file in my SQL Server Database project. And the .sql file was exported by the SQL Server 2014 Database.

    Could you import the .sql file through the above screenshot? Then all Tables have been added to this project. And I create a new .sql file to this project and it also has the intellisense function, please refer to the following screenshot.

    In order to exclude the reasons caused by .sql file, you could create a new .sql file through VS like the above screenshot, and copy the contents from the old .sql file to the new .sql file and try again to observe the results.

    Please free feel to let me know your results.

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, September 26, 2016 2:00 AM
    Moderator
  • Hello

    Sorry for my late response.

    I have fixed my problem by installing Visual Studio 2015 Update 3 (ISO) on my machine. It seems installing newer version of SQL Server Data Tools fixed this issue. This package is included in Update 3 ISO file.

    Have a good day!


    Jalalx


    Monday, October 31, 2016 8:22 AM
  • Hi Jalal Khordadi,

    Glad to know that you have resolved this issue, and thanks for sharing your solution here. 

    Have a nice day:)

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 31, 2016 8:25 AM
    Moderator