Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    335

    Unanswered: SQL-Script to modify data

    Hi all,

    we sometimes copy a prod-DB to our test-Environment.
    In the database is a table which contains filenames for some documents. The filenames are given with UNC-Pathnames like
    \\PROD-SERVER\dirA\dir1\File.txt

    I need to update these Filename to
    \\TEST-SERVER\dirA\dir1\File.txt

    The table has too many rows to do it manually and i don't have that much scripting-knowledge in T-SQL.
    Could somebody give a clue how to do it?

    Cheers
    nvk

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    UPDATE daTable
       SET filename = REPLACE(filename,'\PROD-SERVER\','\TEST-SERVER\')
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2010
    Posts
    335
    Ooops,
    that was simple. Didn't know the replace-function.
    Expected something like a longer script ...

    Thx a lot

Posting Permissions

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