Update in SQL database

Results 1 to 2 of 2

Thread: Update in SQL database

  1. #1
    Join Date
    Dec 1969

    Default Update in SQL database

    I&#039;ve got to run an update query in my database.<BR><BR>I&#039;ve got a TON of regions that display like so:<BR><BR>Toronto and surrounding area<BR>New York and surrounding area<BR><BR>I would like to update these description fields to show<BR><BR>Toronto and area<BR>New York and area<BR><BR>I know how to run an Update query in SQL, I&#039;m just not sure of the proper syntax, and I need to do this right.<BR><BR>UPDATE Region SET Description....<BR><BR>Thats where I&#039;m stuck...

  2. #2
    Join Date
    Dec 1969

    Default RE: Update in SQL database

    try it first in an select statement, view the ouput and if it works change it to an update statement:<BR><BR>SELECT CONVERT(Nvarchar(20),LEFT(Description,CHARINDEX(&# 039;surrounding&#039;,Description)-1)+ &#039; &#039;<BR> +RIGHT(Description,CHARINDEX(&#039;surrounding&#03 9;,Description)+9))<BR>FROM TableName

Posting Permissions

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