Results 1 to 2 of 2

Thread: Converting datatype

  1. #1
    Sam Guest

    Converting datatype


    I need to convert a text field (which contains only numbers) into an int field. What would be the easiest way to do so. SQL 6.5. There are about 100, 000 rows in the db.

    Thanks.

  2. #2
    derek Guest

    Converting datatype (reply)

    i did this recently by creating a new dummy database (with a new name obviously), then scripted the existing db schema (remember to edit the script with the updated datatype) and ran this against the dummy db, then imported all the data from the existing to dummy, finally restored the dummy over the top of the original (BACKUP BEFOREHAND THOUGH!!)

    this all worked fine, although i think there could be a better way (single table restore using some of the above?? or something else) but i had to get it done over a particular weekend so i couldnt wait for answers to come in. someone did tell me afterwards that it could have been done simply by using one of the microsoft developer packages (forget the name) but i'm not sure if this is true. i did download a sql tool (dbartisan) but it gave errors so i just went for the method described above.

    let me know how you eventually do the change cause id be interested to hear.

    derek


    ------------
    Sam at 12/20/2001 12:22:16 PM


    I need to convert a text field (which contains only numbers) into an int field. What would be the easiest way to do so. SQL 6.5. There are about 100, 000 rows in the db.

    Thanks.

Posting Permissions

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