Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: Interesting ! Update query with alias ?

    Hi,

    I have a below Oracle query :

    UPDATE test1 a SET a.sno = 3

    I need the equivalent SQL Server query for the above along with with alias name 'a' set for the table test1. Please advise.

    Thanks,
    Sam

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd use:
    Code:
    UPDATE test1 AS a
       SET a.sno = 3
    -PatP

  3. #3
    Join Date
    Mar 2004
    Posts
    205
    I too tried the same, but I am getting the error 'Incorrect syntax near AS' in SQL Server 2000

  4. #4
    Join Date
    Mar 2004
    Posts
    205
    How about this :

    UPDATE a SET a.sno = 3 FROM test1 a

    This is working fine...

Posting Permissions

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