Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL move text from one field to another

Status
Not open for further replies.

johnpayback

IS-IT--Management
Oct 2, 2006
110
US
Is there an easy way to move specific contents of a text field to another text field? I have text fields in my table that contain comments for each month. At the end of the month I would like to move these contents to a different text field so that the original text field is empty.

I've posted this question in the SQL forum asking how to use a SQL command in a DTS package but I've gotten no responses. Maybe vbscript would be the easier route to take.

SQL 2000 - Windows 2000 Server

JP
 
you can use this sql:
strsql = "UPDATE my_table SET new field = old_field, old_field = '';
 
Will this work for multiple fields? Say I want to move the text contents of 10 different fields all to 1 field. Will this work for it as well?

JP
 
SQL code:
UPDATE yourTable SET singleField=Field1+' '+Field2+' '+ ... +Field10,Field1='',Field2='', ... ,Field10=''

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top