Update Qn

Results 1 to 2 of 2

Thread: Update Qn

  1. #1
    Mansi Kukarni Guest

    Default Update Qn

    I need to update a table (claims), which has a field called group.<BR><BR>my sql:<BR>update claims set field1=whatever, field2=whatever, .., group=whatever<BR><BR>however this gives me the error:<BR>Server: Msg 156, Level 15, State 1, Line 5<BR>Incorrect syntax near the keyword &#039;group&#039;.<BR><BR>my guess is that it is becos group is part of the reserved word. the query works fine when i leave out updating group.<BR><BR>i also tried using claims.group=whatever but that too gives the same error..is there a way of getting round it? <BR><BR><BR>am working on Microsoft SQL Server v8.0 <BR><BR>TIA,<BR>Mansi<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Update Qn

    Yes the &#039;Group&#039; is a keyword used in select statement to retrieve records using &#039;group by&#039; clause.<BR>So for that you have to surround the &#039;Group&#039; column with sqaure brackets :-<BR>update claims set field1=whatever, field2=whatever, .., <BR>[group] = whatever<BR>It is good practise surround all field names with square brackets.(Ex. [field1],[field2] etc.)<BR><BR>

Posting Permissions

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