Home > Archive > MS SQL Server Clients > April 2006 > Error on INSERT Query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Error on INSERT Query
Vijay

2006-04-04, 11:30 am

I want to insert "489d68bf-baa1-415d-94c7-a8e56b-609c61" in a column in sql
server . The data type of this column is varchar (100). i am getting the
folloing error - incorrect syntax near '68bf'. I think it is not accepting
the '-'. How can i get a work around for the '-' so that the above values
gets inserted successfully.
David Owen

2006-04-04, 11:30 am

Vijay,

can you post some sample DDL for the table, as well as the insert statement
that's throwing the error? that value should be legal in the column.

David

"Vijay" <Vijay@discussions.microsoft.com> wrote in message
news:233A3D0E-1A73-424A-BB00- 608D9676247B@microso
ft.com...
>I want to insert "489d68bf-baa1-415d-94c7-a8e56b-609c61" in a column in sql
> server . The data type of this column is varchar (100). i am getting the
> folloing error - incorrect syntax near '68bf'. I think it is not accepting
> the '-'. How can i get a work around for the '-' so that the above values
> gets inserted successfully.



Keith Kratochvil

2006-04-04, 8:27 pm

Are you trying to insert via a stored procedure, or a simple insert
statement?

Try delimiting the string with single quotes. As in:

INSERT INTO YourTable (YourColumn) VALUES
('489d68bf-baa1-415d-94c7-a8e56b-609c61')


Replace YourTable and YourColumn with whatever is appropriate

--
Keith Kratochvil


"Vijay" <Vijay@discussions.microsoft.com> wrote in message
news:233A3D0E-1A73-424A-BB00- 608D9676247B@microso
ft.com...
>I want to insert "489d68bf-baa1-415d-94c7-a8e56b-609c61" in a column in sql
> server . The data type of this column is varchar (100). i am getting the
> folloing error - incorrect syntax near '68bf'. I think it is not accepting
> the '-'. How can i get a work around for the '-' so that the above values
> gets inserted successfully.



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com