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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Concatenation

Author  Topic 

swekik
Posting Yak Master

126 Posts

Posted - 2009-07-08 : 12:20:52
Hi Gurus,I am trying to update one column but it is not updating,What am i doing wrong here?

create PROCEDURE [dbo].[prc_UpDesc]
@numb varchar(100),
@lmnumb varchar(100)
AS
Declare @description varchar(100)
Declare @Message Varchar(100)

set @description = (select description from documents where document_id =@numb )
Set @Message =@lmnumb+' '+@description

Begin

update documents
Set description = @Message
where document_id =@numb

END

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-08 : 12:28:42
do you meant this?


create PROCEDURE [dbo].[prc_UpDesc]
@numb varchar(100),
@lmnumb varchar(100)
AS

Begin

update documents
Set description = @lmnumb+coalesce(' '+ description,'')
where document_id =@numb

END
Go to Top of Page

swekik
Posting Yak Master

126 Posts

Posted - 2009-07-08 : 12:38:40
Yes,Thanks alot visakh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-08 : 12:43:04
welcome
Go to Top of Page
   

- Advertisement -