Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #151
| From | "Bob Barrows" <reb01501@NOSPAMyahoo.com> |
|---|---|
| Newsgroups | comp.databases.ms-sqlserver, microsoft.public.sqlserver.programming |
| Subject | Re: SSE 2008: Trigger: Modifying Data to be Written |
| Date | 2011-04-08 18:44 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <ino33e$1rk$1@dont-email.me> (permalink) |
| References | <ab1vp6pks4qspe0bomof4pcnibgbpu8g10@4ax.com> |
Cross-posted to 2 groups.
Gene Wirchenko wrote: > Dear SQLers: > > How do I modify the data that is going to be written to a table? > > I understand that this data is in a logical table called > inserted, but that this data can not be modified. I really would like > to. > > I want to put a filter in between to clean up the data. The > procedure that I posted recently that cleans up strings would be > useful here. I would like to invoke this in the trigger. > > For example, with my table Accounts, if ACName is entered as > " Account Name " > I would like this to be cleaned up to > "Account Name" > and the latter value be the one written to the table. > > Since I can not write to the inserted logical table, I do not > know how to do this. > > One idea is to disallow application write access to Accounts, > have a shadow table that is written to and in its trigger, process its > rows and write accordingly to Accounts. This seems rather > complicated. I hope that there is a better way. > > Sincerely, > You can use an INSTEAD OF trigger - see Books OnLine
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-08 15:11 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2011-04-08 18:44 -0400
Re: SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-08 16:23 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written Erland Sommarskog <esquel@sommarskog.se> - 2011-04-09 11:22 +0200
Re: SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-09 21:29 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written Erland Sommarskog <esquel@sommarskog.se> - 2011-04-10 14:48 +0200
Re: SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-11 09:46 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2011-04-10 08:54 -0400
Re: SSE 2008: Trigger: Modifying Data to be Written Erland Sommarskog <esquel@sommarskog.se> - 2011-04-10 21:33 +0200
Re: SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-11 09:42 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2011-04-11 14:55 -0400
Re: SSE 2008: Trigger: Modifying Data to be Written Gene Wirchenko <genew@ocis.net> - 2011-04-11 14:53 -0700
Re: SSE 2008: Trigger: Modifying Data to be Written "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2011-04-11 18:49 -0400
csiph-web