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 |
|
adlo
Posting Yak Master
108 Posts |
Posted - 2004-11-30 : 12:45:52
|
| I have an application that needs to customize messages per userHere are my tables:USER TABLEUser_ID int,Name varchar(100)USER_MESSAGE TABLE --Links a user to a messageUser_ID int,Message_ID intKEYWORD TABLEKeyword_ID int,Keyword varchar(100) [1,&Greeting;][2,&Header;][3,&Footer;][4,&Custom1;][5,&Custom2;]etcMESSAGE TABLEMessage_ID int,Message varchar(8000)[1,'...'][2,'...'][3,'...']etc--Messages contain variables e.g. &Greeting; &Footer; &Header; &Custom1; &Custom2; ....--These variable values must gets looked up and translated using the User_Keyword TableUSER_KEYWORD TABLE -- Each user has unique keywordsUser_ID int,Keyword_ID int,Value varchar(100)[1,1,'Howzit'][2,1,'Hi']etcMy question is:I want to somehow do multiple(X) Replaces on Message using the User_Keyword Table for translating the keywords.I guess one has to write a UDF to do this but this is bit beyond me.If anyone can point me in the right direction or if anyone has a sql for a similar situation I would really appreciate it if you could share it with me.Thanks. |
|
|
tuenty
Constraint Violating Yak Guru
278 Posts |
Posted - 2004-11-30 : 15:49:43
|
| can you post a before update and after update dataUpdate USER_KEYWORDset Value = @newValueWhere User_ID = @User_ID and Keyword_ID = @Keyword_ID*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*A candle loses nothing by lighting another candle |
 |
|
|
|
|
|
|
|