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 |
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2012-11-13 : 21:28:59
|
how can i update email address which is nvarchar(200) to add in additional date and notes?Example: abc@yahoo.com update to abc_NEW20121114@yahoo.comI tried as below but hit this error 'Conversion failed when converting date and/or time from character string'DECLARE @email nvarchar(200)DECLARE @date datetimeSET @userName= 'abc@yahoo.com'SET @date= GETDATE()Update tableAset email= @userName+@datewhere email= @userName |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-11-13 : 21:47:23
|
[code]SET email= stuff(@userName, charindex('@', @userName), 0, '_NEW' + convert(varchar(10), @date, 112))[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|