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 |
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2008-07-27 : 22:31:26
|
How can i combine existing one(nvarchar type) and new one in update statement?In this procedure,i want to add @cmt to comment but i don't want to remove existing comment.CREATE PROCEDURE [dbo].[update] @id int,@cmt nvarchar(500)ASupdate tblRenewalListset Comment=@cmtwhere AutoID=@idGOThanks in advance. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-27 : 22:39:41
|
[code]update tblRenewalListset Comment = Comment + @cmt[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2008-07-27 : 23:15:04
|
Thank u.quote: Originally posted by khtan
update tblRenewalListset Comment = Comment + @cmt KH[spoiler]Time is always against us[/spoiler]
|
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-28 : 10:28:31
|
is Comment nullable? if yes, you need to account for nulls alsoCREATE PROCEDURE [dbo].[update] @id int,@cmt nvarchar(500)ASupdate tblRenewalListset Comment=coalese(Comment,'') + @cmtwhere AutoID=@idGO |
 |
|
|
|
|