Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update/set without overwrite

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-11-08 : 09:48:47
In doing a data conversion i had to stuff data that would not fit into it's intended field into a field with larger string values. After doing so, it turns out that the receiving field for this data is no longer used by our front end application, hence the data cannot be seen by the customer. Thanks to the engineers for not letting the dba's know which fields they've dropped!
What i need to do is write some update/Set scripts to move the data from that dead column (civil.dbo.subjects.other) to another column in another table(civil.dbo.receipts.comments). i have no problem with those scripts, but i do NOT want to overwrite the data that is already in the comments column in the receipts table. what do i need to add to that script to allow it to append the data in that column as opposed to replacing it?

thanks

X002548
Not Just a Number

15586 Posts

Posted - 2011-11-08 : 09:50:06
SET Col1 = Col1 + Col2

???

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-11-08 : 09:56:42
Does the "???" mean you're not certain?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-11-08 : 09:59:20
How can I tell? do you think you supplied enough information?

Post the DDL, sample data in DML format and what the expected results should be....but that should do what you want

Do it as a select first before you try the update



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -