Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,226 of 19,505    |
|    Erland Sommarskog to Bob Barrows    |
|    Re: SSE 2008: Trigger: Modifying Data to    |
|    10 Apr 11 21:33:33    |
      XPost: microsoft.public.sqlserver.programming       From: esquel@sommarskog.se              Bob Barrows (reb01501@NOSPAMyahoo.com) writes:       > Gene Wirchenko wrote:       >>> 2) I think that maintainability was covered by the code I borrowed       >> from. My derivative has       >> select * into #Inserted from Inserted       >> at the beginning and then at the end, writes with       >> insert into Accounts select * from #Inserted       >>       >       > You consider this to be a good idea? Despite the number of experts in the       > field that advise against using selstar (select *)? I won't repeat that       > advice here: it's very easily found. I will say that I have never seen an       > expert recommend its use.              As I indicated in my reply to Gene, I think he has a point here.              But as I said, there are couple of situations where it will not work. And I       forgot quite an important situation: UPDATE statements. Most likely, Gene       would like to use his INSTEAD OF trigger for updates as well, and you       cannot do UPDATE tbl SET CORRESPONDING as in Cobol. So for updates he would       have to list all columns.              ...unless he first deletes the rows to be updated and the insert like above.                                                 --       Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se              Links for SQL Server Books Online:       SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx       SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca