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 |
|
mistux
Yak Posting Veteran
90 Posts |
Posted - 2005-06-25 : 13:10:30
|
I am tryign to update a field that allready contains data with some new data.Example for field OrderNotes:Existing:"Order received."What I want to add to it:"Order halted 6-25-05"What should now be in the field OrderNotes (without quotes):"Order halted 6-25-05""Order received."Here is what I thought I could use:( @WOID int, @Reason nvarchar(150) )AS UPDATE [T_SetupSheetHistoryOrderNotes]SET[T_SetupSheetHistoryOrderNotes].OrderNotes=@Reason + [T_SetupSheetHistoryOrderNotes].OrderNotesFROM [T_SetupSheetHistoryOrderNotes] WHERE [T_SetupSheetHistoryOrderNotes].WOID=@WOID MichaelFor all your DNC needs for your CNC machines. www.mis-group.com |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2005-06-25 : 15:03:16
|
| Is OrderNotes a TEXT or NTEXT column?Mark |
 |
|
|
mistux
Yak Posting Veteran
90 Posts |
Posted - 2005-06-25 : 15:13:03
|
| It is NTEXT.MichaelFor all your DNC needs for your CNC machines. www.mis-group.com |
 |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2005-06-27 : 04:30:42
|
| That explains it - Look up UPDATETEXT in BOL. |
 |
|
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2005-06-27 : 13:25:43
|
| Or you can change it to varchar(8000). Or will it need to be bigger than 8000?BrendaIf it weren't for you guys, where would I be? |
 |
|
|
mistux
Yak Posting Veteran
90 Posts |
Posted - 2005-06-27 : 13:57:46
|
| OK, thanks that looks liek what I want, now I just have to get the syntax correct.Is this correct?(@WOID int, @Reason nvarchar(150))ASselect[T_SetupSheetHistoryOrderNotes].OrderNotesFROM [T_SetupSheetHistoryOrderNotes] WHERE [T_SetupSheetHistoryOrderNotes].WOID=@WOIDUPDATETEXT [T_SetupSheetHistoryOrderNotes].OrderNotes 0 @ReasonThe 0 is for inserting my @Reason data at the top.MichaelFor all your DNC needs for your CNC machines. www.mis-group.com |
 |
|
|
|
|
|