Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Question Unanswered: Help me Insert/Update!!!

    Can someone please Help,

    I'm trying to write an insert/update query but it doesn't work.
    My syntax is similar to the following

    INSERT/UPDATE INTO GL_SCORE VALUES (1, 'andrew');
    INSERT INTO GL_SCORE VALUES (2, 'gordon');
    SELECT * FROM GL_SCORE

    But it doesn't work, why?

    Please help me insert/update becuase it would be good.

  2. #2
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Help me Insert/Update!!!

    RTFM

    Look up the syntax for UPDATE & INSERT, I'm sure you can answer your question by yourself.
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  3. #3
    Join Date
    Sep 2003
    Posts
    2

    Question No syntax on insert/update

    Hi,

    I found syntax on insert and update but nothing on insert/update, like doing them both at once. Why?

  4. #4
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: No syntax on insert/update

    Why do you think, that SQL Server has a Update/Insert command, like Oracle 9i has it's MERGE? Which SQL Server version you are talking about?
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  5. #5
    Join Date
    Jul 2003
    Posts
    21

    Lightbulb I dont think we have Insert/Update here!!!

    Dear Tronboy

    I have never encountered Insert/Update in SQL Server syntax
    I think you will have to choose, either its INSERT or UPDATE

    If its a type of functionality or logic which is often used you should consider putting it in a user defined function or sproc.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Tronboy,

    Insert and Update are two different command in SQL Server (although updates actually involve deleting and reinserting rows, this all happens behind the scenes).

    You may be getting confused because triggers can be set to execute and update.

    blindman

  7. #7
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447
    Originally posted by blindman
    You may be getting confused because triggers can be set to execute and update.
    blindman
    Good point, blindman; this is the way to confuse TronBoy completely. I'm proud of you!
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •