Professional Web Applications Themes

Replace data in one column out of 14 - Microsoft SQL / MS SQL Server

I need to replace the data in one column and keep the rest. I have 18,000 row. I tried various import/export procedures, but i'm not certain that the data is kept in a consistent state. I have two tables: One with working data (14 columns) and one with the new data (2 columns). each table has a unique identifier. Regards Tonny *** Sent via Developersdex [url]http://www.developersdex.com[/url] *** Don't just participate in USENET...get rewarded for it!...

  1. #1

    Default Replace data in one column out of 14

    I need to replace the data in one column and keep the rest. I have
    18,000 row.
    I tried various import/export procedures, but i'm not certain that the
    data is kept in a consistent state.

    I have two tables:
    One with working data (14 columns) and one with the new data (2
    columns). each table has a unique identifier.

    Regards Tonny



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Tonny René Poulsen Guest

  2. #2

    Default Re: Replace data in one column out of 14

    UPDATE TargetTable
    SET somecolumn =
    (SELECT somecolumn
    FROM SourceTable
    WHERE keyid = TargetTable.keyid)

    --
    David Portas
    ------------
    Please reply only to the newsgroup
    --

    "Tonny René Poulsen" <anonymousdevdex.com> wrote in message
    news:uZtPp4NQDHA.704tk2msftngp13.phx.gbl...
    > I need to replace the data in one column and keep the rest. I have
    > 18,000 row.
    > I tried various import/export procedures, but i'm not certain that the
    > data is kept in a consistent state.
    >
    > I have two tables:
    > One with working data (14 columns) and one with the new data (2
    > columns). each table has a unique identifier.
    >
    > Regards Tonny
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    David Portas Guest

  3. #3

    Default Re: Replace data in one column out of 14

    Thank you,
    This is exactly what I was looking for :D you saved me
    Unregistered Guest

Similar Threads

  1. #39387 [NEW]: preg_match/replace segfaults on certain user data.
    By php at vicaya dot com in forum PHP Bugs
    Replies: 2
    Last Post: December 1st, 08:23 PM
  2. Getting column data without column names
    By Jared@Itron in forum Coldfusion Database Access
    Replies: 4
    Last Post: January 18th, 09:26 PM
  3. Template Column data depending on form data
    By John Mackerras in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 15th, 01:05 PM
  4. Replace characters in a Field when bindig data
    By Satish Appasani in forum ASP.NET General
    Replies: 1
    Last Post: July 17th, 12:21 PM
  5. DataTable - replace values in column
    By Beza in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: July 7th, 10:01 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139