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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-06-03 : 07:44:56
|
| Paul writes "Good day. I have searched for this answer far and wide and have not found it. I hope you can help.'Help me Obi Wan. You're our only hope.'SQL 7I am working on a stored procedure where data from one table is being copied into another table. The fields in question are text fields. Not my design, I'm cleaning up. I can't use a subquery because it is a text field. I want to use writetext but I can't seem to figure out how to get the source data to the destination. Here is what I have so far, basically copied from Books On Line.declare @destination binary(16)Select @destination = TEXTPTR(myDestination) from myDestinationTablewritetext myDestinationTable.myDestination @destination 'This text will be inserted.'What I need is this.declare @destination binary(16)declare @source binary(16)Select @source = TEXTPTR(mySource) from mySourceTableSelect @destination = myDestination from myDestinationTablewritetext myDestinationTable.myDestination @destination @sourceI have tried adding a readtext in this as well. I end up with the binary pointer being written to the table and not the text. How can I do this OR is there a better way?Thank you very much.souLTower" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-06-03 : 12:00:46
|
| If you want the whole text data copird you should be able toupdate desttblset txtfld = s.txtfldfrom desttbl djoin sourcetbl son s.id = xxxand d.id = xxxxIf you want to manipulate the data you will have to do it in chunks as inhttp://www.mindsdoor.net/SQLTsql/InsertTextData.html==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|