Re: Syntax error in insert statement?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Tried it. It made no difference. I didn't expect it to work since I did not
have to use brackets to make it work with named parameters.

"Val Mazur (MVP)" wrote:

> Hi,
>
> Te reason for this error is that Name is a reserved word. You should wrap it
> into square brackets.
>
> insert into BusDataObject (View_ID, [Name], NameSpace) Values (?, ?, ?);
>
> And never use concatenation to build queries as suggested in another post
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "dkocur" <dkocur@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:45B7B545-F78B-41D0-AC2C-0EA0A006F33C@xxxxxxxxxxxxxxxx
> > "insert into BusDataObject (View_ID, Name, NameSpace) Values (?, ?, ?);"
> >
> > results in "Incorrect syntax near '?'."
> >
> > I'm using C# Express Beta 1 with SQL Server. I know it has to be
> > something
> > simple, but I just can't figure it out.
>
>
>
.



Relevant Pages