Das Blog

Debugging one line at a time
$1*/ mo WordPress hosting! Get going with GoDaddy!
Menu
  • Home
  • Coding
    • Entity Framework
    • MVC
    • NHibernate
  • JavaScript
    • TypeScript
  • Hosting
  • SEO
  • Social
  • Database
    • MySql
    • SSIS
  • WP
  • Other
    • CakePHP
    • Error Messages
    • Google Maps
Home
Coding
MVC
Error SQL03070 This statement is not recognized in this context
MVC

Error SQL03070 This statement is not recognized in this context

Codex Discipulus June 2, 2011

I am finally back to working with MVC (now version 3.0 with Razor) and other technologies like dependency injection (Unity this time) and ORM (Entity Framework). So far so good, but expect more updates.

I was trying to compile my VS2010 MVC project, which includes a Database Project (BTW, awesome upgrade on the way Database projects work now in conjunction with Visual Studio) right after adding a new Store Procedure when I got this error message during the build process:

“Error SQL03070: This statement is not recognized in this context.”

The stored procedure causing the error is also displayed to read something like this:

“{my path}\MyProject.DB\SCHEMA OBJECTS\SCHEMAS\DBO\PROGRAMMABILITY\STORED PROCEDURES\{name of my new stored procedure}.PROC.SQL(X,Y):”

The problem has to do with the way I created the stored procedure. I was making a change to an already existing stored procedure from a QUERY window in SQL Server 2005 management studio, and somehow I copy and paste with a “ALTER PROCEDURE” command instead of the requireed “CREATE PROCEDURE” command.

Mistake number two was to keep the USE statement as in “USE [name_of_my_database]” when is not allowed inside the database project.

Mistake 3 and 4 had to do with keeping “SET ANSI_NULLS ON’ and “SET QUOTED_IDENTIFIER”.

Once I removed those 4 statements from the stored procedure, I was able to compile and build without any errors. Lesson learned.

Share
Tweet
Google+
Linkedin
Stumble
Email
Prev Article

Related Articles

Latest T4 Toolbox incompatible with S#arp CRUD Scaffolding
The following error came up when running the CRUD ScaffoldingGeneratorCommand …

Latest T4 Toolbox incompatible with S#arp CRUD Scaffolding

Working, coding and debugging within Visual Studio environment is very …

MVC + Sharp + IIS7 + NHibernate

About The Author

Codex Discipulus

Hello, my name is David and I am a disciple of coding, always learning and always ready to help. Welcome to my blog, I hope you find it useful, please send your comments and share an article with your friends.

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Hosting ASP.Net Core 3.x Worker Service as …
    Using the Worker template now is possible to host an …
  • Calling an HTTPS WCF Service from Net …
    We all know how to call a WCF service from …
  • How to Add a VS Code Project …
    Let’s try to add a Visual Studio Code project to …
  • Step by Step Token based Authentication in …
    Token Authentication is a very popular method to secure a …
  • How to Ignore NuGet Packages in TFS …
    This should be a short post. It is really just …

Categories

  • CakePHP
  • Coding
  • Database
  • Entity Framework
  • Error Messages
  • General
  • Google Maps
  • Hosting
  • JavaScript
  • MVC
  • MySql
  • Net Core
  • NHibernate
  • SEO
  • SSIS
  • TypeScript
  • Wordpress

Tags

ActiveDirectory analytics apps aspnet CakePHP coding database projects design patterns entity framework error messages fatcow first steps ftp github gitlab godaddy google maps api hangfire Hosting iis7 java javascript membership MVC MySql NHibernate nuget nuget packages oracle owin repository SEO sharp ssis t4 tfs thesis token authentication typescript vs2010 vs2015 vs2017 web api Wordpress wp-pagenavi

Das Blog

Debugging one line at a time
Copyright © 2020 Das Blog
ScottsdaleWebStudio.com © All Rights Reserved 2017