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 |
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2009-08-10 : 16:08:55
|
| Ok. I am going to make this explanation visual. [code]Resp_Code|Conflicts________A_______|_____B,D,C_____________B______|______D,A______________C______|______A__________________D______|______A,B_________________T_______|___C* Important,I want to add this conflict to Row C separate by a comma after the letter "A"./code]Ok. I know it looks a little confuse. In the first case "A" is conflicting with "B", "D", "C" - So, you can see that B, D, C rows has A as part of their conflict. If I enter a new row for example row T conflict with Row C, I want to be able to add this conflict next to A separate it by a comma. Also, If I delete, I want to be able to delete all the entries for that specific Resp_Code. Any help is welcome.Thank you. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-08-11 : 00:09:21
|
like this ?declare @Resp_Code char(1), @Conflicts char(1)select @Resp_Code = 'C', @Conflicts = 'T'update tset Conflicts = Conflicts + ',' + @Conflictsfrom yourtable twhere t.Resp_Code = @Resp_Code KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2009-08-11 : 10:38:38
|
| Thank you khtan, I'll give it a try. Thanks, |
 |
|
|
|
|
|
|
|