Geeks With Blogs

News

View Anthony Trudeau's profile on LinkedIn

Add to Technorati Favorites


Anthony Trudeau

When you add SQLCMD statements to a pre-deployment or post-deployment file in a database project in Visual Studio 2010.  You might see the error "SQL80001: Incorrect syntax near ':'".  This is not a real error assuming you have the correct SQLCMD syntax.

To clear the errors temporarily right click on the document and select SQLCMD mode.

Posted on Friday, March 5, 2010 10:25 PM | Back to top


Comments on this post: SQL80001: Incorrect syntax near ':'

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Thanks. This is not error but annoying to see and distinguish between real errors and fake:) errors. Helpful tip.
Left by Jawahar on Oct 21, 2010 11:47 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Plz help me
Left by Rahul on Oct 25, 2010 1:49 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
I found the solution:
To clear the errors temporarily right click on the document and select SQLCMD mode.

source: http://wwww.geekswithblogs.net/tonyt/archive/2010/03/05.aspx
Left by P-KoS on Jan 28, 2011 3:52 PM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Thanks for the tip !
Works like a charm
Left by bart_dk on May 21, 2011 5:42 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Thanks man! works gr8
Left by KK on Aug 08, 2011 1:39 PM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
thanks for the suggestion.
it works fine.
Left by Surya on Oct 13, 2011 5:50 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
FYI, in Visual Studio 2012 the menu option changes to Execution Settings->SQLCMD Mode
Left by Anthony Trudeau on Nov 09, 2012 3:28 PM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Right click on Project Properties in solution explorer
On Target Database settings
Edit and choose the destination database.

This solved my similar problem, hope that solves yours too.. :)
Happy Coding
Left by Anand on Dec 19, 2012 3:18 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Thanks for the tip - helped me out
Left by philicomus on Apr 18, 2013 3:41 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
This error code is SQL80001
why?
CREATE PROCEDURE [dbo].[sp_insert_user]
@UserName nvarchar(50),
@Password nvarchar(50),
@Fname nvarchar(50),
@Lname nvarchar(50)
AS
INSERT INTO User (UserName,Password,Fname,Lname) VALUES (@UserName,@Password,@Fname,@Lname)
RETURN 0
Left by sam on Oct 27, 2013 10:19 AM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
I love raising threads from the dead...

Script files do not need to be compiled.

So you can rid yourself of this issue by changing the build action, on the script files properties, to "None". You'll have to do that for every script file you add to the project but only once for each.
Left by Jeremy on Sep 08, 2014 3:33 PM

# re: SQL80001: Incorrect syntax near ':'
Requesting Gravatar...
Thanks for the tip, It worked for me.
Left by lunawolfs on Feb 11, 2015 12:57 PM

Your comment:
 (will show your gravatar)


Copyright © Anthony Trudeau | Powered by: GeeksWithBlogs.net | Join free