Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: NText Update field

    Hi All,

    I will be doing stress test for my app.

    Loading thousands of records to the DB through bulk insert.
    There's one field NText which I have left NULL because it will be hard to gen dummy flat file to it.

    I have another table which has the Ntext Value which i will want to copy and duplicate to the other table.

    what is the way to do it?

    simply said i want to update a record with NULL value from one table with NText field with the value from another table..

  2. #2
    Join Date
    Aug 2004
    Posts
    10
    check out 'UPDATE ... FROM' in BOL

    try this:

    create table table1(col1 ntext, col2 int)
    create table table2(col1 ntext, col2 int)

    insert into table1 values ('a', 1)
    insert into table1 values ('b', 2)
    insert into table1 values ('c', 3)

    insert into table2 values (null, 1)
    insert into table2 values (null, 2)
    insert into table2 values (null, 3)

    update t2 set t2.col1 = t1.col1 from table1 t1 inner join table2 t2 on t1.col2 = t2.col2

    select * from table2

    hth,
    Cristian Babu

Posting Permissions

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