Re: SQL Native Client Incorrect syntax near Error



RolyMaz wrote:
Hi,

When i run a trace i see the following syntax error on a stored
procedure:

E000 exec dbo.Lead_UpdateLeadContactOutcome
@Username=N'SBHU328',@COGroup=N'No Contact',@CODetail=N'Voice
Mail',@LeadStatus=N'Retry',@VelocitiCallOutcome=N'Not
Pitchable',@ClientCallOutcome=N'Good
Data',@LastContactDate=''2007-09-25
17:49:21:260'',@RetryDate=''2007-09-26
17:49:21:260'',@ContactCounter=3,@CurrentNoOfRetry=3,@ContactType=NULL,@VelocitiLeadID=996078

1 [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near
'2007'.

This stored procedure is called from a VB.NET application, using the
VS 2005
Data Designer.

The reason for the error is clear - the date values are enclosed in
double (2 x ) apostrophes. I cannot work out why this is happening?

Without seeing the code that generated this, I suspect everyone else will be
mystified as well.

BTW, are you sure the quotes are the problem? Have you tested this in SSMS?

There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic ADO newsgroup. ADO.Net bears
very little resemblance to classic ADO so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.adonet.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Null values for parameters in Preview Data dialogue?
    ... but this is a classic ADO newsgroup. ... parameterised stored procedure. ... The problem I have is that the Preview Data dialogue demands that I ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: How do I link the results from sp_executeSQL to a gridview?
    ... I built a stored procedure that needed to use dynamic sql for a search ... but this is a classic ADO newsgroup. ... gridview and simply call the Fillmethod but the ...
    (microsoft.public.data.ado)
  • Re: Command object and batching stored procedure calls
    ... I have to call a stored procedure over and over as ... That's because there is no way without using dynamic sql to concatenate ... Session pooling should guarantee connection re-use if you ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: dll & Web Service in VB.Net 2005 Stored Procedure
    ... I have given an answer in another newsgroup where you have placed the ... I have two questions for this stored procedure. ... Using cmd As New SqlCommand ... .CommandText = strSQL ...
    (microsoft.public.dotnet.general)
  • Re: dll & Web Service in VB.Net 2005 Stored Procedure
    ... I have given an answer in another newsgroup where you have placed the ... I have two questions for this stored procedure. ... Using cmd As New SqlCommand ... .CommandText = strSQL ...
    (microsoft.public.dotnet.general)