Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6921505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:17:07+00:00 2026-05-27T10:17:07+00:00

Hello I am working on a SQL database Using Microsoft SQL server 2008 R2

  • 0

Hello I am working on a SQL database

Using Microsoft SQL server 2008 R2
And Microsoft SQL Server management studio

I have a Database Called FixedNamesDb
On the database there is one table called All

It is similar to this (this is an example):

OldNames        NewNames
------------+---------------+
tom G         Thommas Grady               
Kate F        Kateline Farwell               
John S        Jhon Smith    

In another Database Called DescriptionDb There is lots of tables Table1, Table2, Table3 ….

Foreach Oldname in the FixedNamesDb I need to search all the tables in the DescriptionDb and if the oldname appears in any field i need to replace it with the newName

I search all the tables in DescriptionDb for a field containing “John S” and replace it with “Jhon Smith”

Any help on how to do this automaticaly? Usding a script, a query or something else.

More info:

  • Each Name Appears only one time in one of the tables of DescriptionDb

  • All the names appears (there is no name that does not exists)

  • All the names are located in the Second Row of the table (Row where ID=2)

Thanks a lot for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:17:08+00:00Added an answer on May 27, 2026 at 10:17 am

    Use this script for each table that needs to be updated.

    UPDATE
      DescriptionDb.Table1
    SET
      Name = FN.NewName
    SELECT
      FixedNamesDB.[All] AS FN
    WHERE
      Name = FN.Oldname
    

    The following script can find all tables and columns. Using a programming or scripting language loop through all tables and columns replacing Table1 and Name in the above script with all iterations of the script below.

    SELECT
      TABLES.TABLE_SCHEMA + '.' + TABLES.TABLE_NAME 'TABLE_NAME',
      COLUMNS.COLUMN_NAME,
      COLUMNS.DATA_TYPE,
      COLUMNS.CHARACTER_MAXIMUM_LENGTH
    FROM 
      INFORMATION_SCHEMA.COLUMNS,
      INFORMATION_SCHEMA.TABLES
    WHERE
      COLUMNS.TABLE_NAME = TABLES.TABLE_NAME
      AND TABLES.TABLE_SCHEMA = 'DescriptionDb'
    ORDER BY
      TABLES.TABLE_SCHEMA,
      TABLES.TABLE_NAME,
      COLUMNS.COLUMN_NAME
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have created one windows application in c# .net and its working fine
Hello I m working on j2me application. There is one form in which I
Hello everybody I have some certs in SQL 2008 but am by no means
Hello I have table in my database holding some browser information I'm currently using
Hello I have this list that i am working on. When i move the
HELLO, I am working on XCODE 3.1.4 , my iphone have 3.1.2 os...But as
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
hello everyone I'm working with Eclipse under Windows XP, but I can't find there
Hello i have this grid working fine here: http://tourscript.com/jqueryasp/default2.asp i start adding a pagination
Hello I am currently working on a django project, in one of my Models

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.