I have a product table look like:CategoryID(PK) Categoryname ------------------------------1000 computer1001 book1003 music: : :: :: : 1500 Movie
and I am trying to update categoryname looks like:CategoryID(PK) Categoryname ------------------------------1000 computer-10001001 book-10011003 music-1003: : :: :: : 1500 Movie-1003
I was using the following Update statement ,but it didn't work.Declare @x intDeclare @category varcharset @x = categoryidbeginupdate categoryset categoryname = @category + ' - ' + @xwhere categoryname = @categoryEnd
Do I need to use a cursor?