Sql Server-How to insert values to database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeenajos
    New Member
    • Oct 2007
    • 71

    Sql Server-How to insert values to database?

    Hi all,
    while writing a query to insert values into a database it gave me an error.

    Query goes like this:
    Insert into [DatabaseName].[dbo].[DB]
    ([Type]
    ,[Message]
    ,[Category])
    Values
    (<Cargo,Varchar (50),>
    ,<Shipping experts ABC.Call-xx-xxxx,varchar,>
    ,<Cargo,Varchar (50)>)

    Its showing the error "Incorrect syntax near '<' "
    Can anyone help???

    Thanks Jeen
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Try this:

    Code:
    Insert into [DatabaseName].[dbo].[DB]
    ([Type]
    ,[Message]
    ,[Category])
    Values
    ('Cargo',
    'Shipping experts ABC.Call-xx-xxxx',
    'Cargo')
    I could only guess what are you trying to do with this mess.
    Hope your table name is DB.

    Comment

    • jeenajos
      New Member
      • Oct 2007
      • 71

      #3
      thank You for your solution. It worked.

      Jeen

      Comment

      Working...