October 5, 2014 by Nitesh

Solution: SSDT – Error SQL70001 This statement is not recognized in this context


In this post we will see how can we resolve a very common error while working with SQL Server Data Tools in Visual Studio. The error statement is – “Error SQL70001: This statement is not recognized in this context“. This error occurs in Visual Studio whenever we try to execute some SQL statements which are not DDL in nature. For ex – INSERT, UPDATE statements present in a SQL Script might throw this kind of error.

There is a very simple trick to resolve this issue. Let’s see what need to be done.

  • Select the SQL script that is throwing this error.
  • Go to Properties window and change the “Build Action” property for the script from “Build” to “None“.SSDT
  • You’re done. Recompile the project without any errors.

Hope you like this small tip. Keep learning and sharing! Cheers!

#ASP.Net#Error#Solution#SQL Server#SSDT
  • Nirman

    There are number of script files (for Stored Procedures, Functions, etc) in my database project. And I get thousands of SQL70001 errors while I build. I checked the properties of a few files, and could see the “Build Action” property set to “Build”. Is there any option to change Build Action property of all .sql files in a single shot, rather than doing it manually?

Support us!

If you like this site please help and make click on any of these buttons!

Powered by WordPress Popup