Re: Syntax error in insert statement?



Strange. I am pretty sure that 99.9% Name field cause it. Otherwise I do not
see anything wrong here. What is your code that executes this statement?

--
Val Mazur
Microsoft MVP

http://xport.mvps.org



"dkocur" <dkocur@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:08E3B60A-D4E2-449D-9750-7F532A7A7101@xxxxxxxxxxxxxxxx
> 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