18,297 reputation
453102
bio website sqlperformance.com/author/…
location New Zealand
age 45
visits member for 3 years, 4 months
seen 1 min ago

Apr
24
reviewed Close How can I find out what makes my archived redo logs grown so fast
Apr
24
reviewed Approve suggested edit on How to Move All tables from one Database into Different Database?
Apr
24
comment Synchronization using triggers
@Yiping I hope I made it clear in my answer that I do not favour trigger code for this sort of requirement. Indexed views and constraints have important benefits. I'm not sure exactly what you mean by "business logic" (stored procedure? application-level code?) but the same fundamental issues exist, and you have to be very careful. If correctness is not actually rigorously enforced in the database, things can go wrong.
Apr
23
reviewed Reviewed best practice for 'staging' relation in stored procedure: use temp table, or view?
Apr
23
reviewed No Action Needed mongodb 2.6 mongos start up failed
Apr
23
reviewed Close Sql Server 2012 Enterprise Backup with no file
Apr
23
reviewed Approve suggested edit on sql-audit tag wiki
Apr
23
reviewed Approve suggested edit on sql-audit tag wiki excerpt
Apr
23
awarded  Enlightened
Apr
23
awarded  Nice Answer
Apr
23
reviewed Reviewed MS SQL Server 2012 Failover Cluster connection issue
Apr
23
reviewed Reviewed App domain is marked for unload due to memory pressure
Apr
23
comment Synchronization using triggers
@Yiping Yes, exactly the same. I used (0 - x) because unary minus can be easy to miss. $0 is just zero typed as money (the same type as the Amount column).
Apr
23
comment Need help with SQL Server PIVOT
@jamauss row_number() over (partition by office_id order by <key>)
Apr
23
revised Need help with SQL Server PIVOT
Added non-PIVOT example for completeness
Apr
23
comment Need help with SQL Server PIVOT
@jamauss Note that without a key in the base table to order by, there is no guarantee the settings values will be pivoted in any particular order per office_id, nor is there any guarantee that they will be arranged the same way on each output row.
Apr
23
revised Synchronization using triggers
added 251 characters in body
Apr
23
answered Synchronization using triggers
Apr
23
reviewed No Action Needed How can i insert the multiple data in table using the existance condition?
Apr
22
reviewed Leave Open How to structure renting and sale as type of purchase?