| | |||||||
|
Welcome to the YD Scuba forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
| Non Diving Posts: Discuss SQL Assistance in the Non-Diving Related Forums forums: Hi can someone help me with the following I have two fields in a table that need to be concatenated ... |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| Can't you just do a normal INSERT using the + operator to concatenate?
__________________ Ian |
| ||||
| Sorry, UPDATE obviously, not INSERT (duh)
__________________ Ian |
| ||||
| Quote:
whoops, sorry edit: however, moving the table temporarily to SQL2005 and then doing this works... UPDATE MIGRATION_COMMUNICATION SET COMM_NOTE=RTRIM(COALESCE((CAST(DOCDESC AS VARCHAR(MAX))),'')) + ' '+'-'+' ' + RTRIM(COALESCE((CAST(MEMO AS VARCHAR(MAX))),'')) FROM MIGRATION_COMMUNICATION |
| ||||
| Try WRITETEXT instead of UPDATE, something like this. I'm guessing on the exact syntax here cos I don't have a SQL2000 database to play with. WRITETEXT MIGRATION_COMMUNICATION.COMM_NOTE (SELECT RTRIM(DOCDESC) + ' '+'-'+' ' + RTRIM(MEMO) FROM MIGRATION_COMMUNICATION)
__________________ Ian |
| ||||
| Quote:
__________________ Wilbo. |
| ||||
| Quote:
|
| ||||
| Update to the above. Looks like you need a TEXTPTR as part of the syntax. So the above gets changed to: DECLARE @ptrval varbinary(16) SELECT @ptrval = TEXTPTR(MIGRATION_COMMUNICATION.COMM_NOTE) WRITETEXT MIGRATION_COMMUNICATION.COMM_NOTE @ptrval (SELECT RTRIM(DOCDESC) + ' '+'-'+' ' + RTRIM(MEMO) FROM MIGRATION_COMMUNICATION)
__________________ Ian |
| Thread Tools | |
| Display Modes | |
| |
| | ||