2,240 reputation
49
bio website
location
age
visits member for 1 year, 7 months
seen yesterday
stats profile views 122

May
14
comment Left Join not giving desired result
Your problem is the data doesn't support the result set you want. You have no payments for fee 300.
May
14
answered Left Join not giving desired result
May
8
comment SQL Server Trigger Performance- Is Using Trigger is a good way?
Another benefit of using triggers for auditing it that it catches changes that are made outside the application including those made maliciously by disgruntled employees. Ther are also many times when an ad hoc query is written to change data. Auditing should NEVER be anywhere except the database. Doing it inthe application totally defeats the purpose of auditing.
May
7
comment Tool to view intermediate query results
Of course you are far less likely to get a Cartesian product accidentally if you use explicit joins.
May
3
comment How can we get tablename from inside of Trigger Code?
and since you would need to change all references to that table why is that a problem? Personally it is rare to ever change a table name in a good design. If you are thinking about changing names, then you probably need to rethink that.
May
3
comment Real-time merge of two SQL Server databases on different servers
IS there some reason why you haven't tried using replication?
Apr
29
comment Transfer 1 million records from one table to another
@dezo, that information is easily avialble in Books Online. This answer is fine as it is. We don't need to spoon feed people.
Apr
22
awarded  Necromancer
Apr
18
comment Optimizations Possible - SQLServer
Reallly stop using implict joins, this is the 21st century after all. Those queries are harder to debug, likely to be harder to maintain and are far liklier to return the incorrect result.
Apr
17
comment Why are constraint applied in database rather than code?
You should never base a database design on the objects in your application. You would noramlly design this as person, then have a related table to deinfe the persons roles. Then the problem doesn;t come up as you havea realted table for the roles sso people can have multiple roles. If you want to have only one role person, then you constrain the table so that the peopleID is unique. When you want to change that remove teh constraint.
Apr
17
comment Why are constraint applied in database rather than code?
Excellent point about application developers designing for the editors and not the users of the data.
Apr
17
revised MySQL: Join one Row in a table with two Rows in other table
fixed code based on comment
Apr
16
comment MySQL: Join one Row in a table with two Rows in other table
If you would never have the case where the person is also the created by or if you would want two records in that case, then use UNION ALL as it tends to be faster.
Apr
16
answered MySQL: Join one Row in a table with two Rows in other table
Apr
16
comment MySQL: Join one Row in a table with two Rows in other table
You did use a join you just used an implict join whch you shoudl stop using as they are SQL antipatterns
Apr
15
comment Approach for a 2,000 table migration
If the structures will be different, it is worth the time to specifically figure out the mappings of every table/column to the new version. That takes a while in 2000 table migration but having amapping document will help you tremendously. Especially when you have differnt datatypes and you must convert them and what to do if the data cannot convert. Your current system may have dates stored in varchar and has some records where the date isn't a real date, if the new system uses date datatypes for dates, then you have to figure out what to do with the data that won't fit into it.
Apr
12
comment How database administrators can see my requests to MSSQL server?
Why would a dba answer this question?
Apr
12
answered Why are constraint applied in database rather than code?
Apr
10
comment With SQL Server 2008, how can I roll back a transaction done some time before?
Frankly this is why I believe that any non-trivial database needs audit tables. Any database that stores financial data needs them twice as much.
Apr
10
comment Is there a workaround for lack of support of cascade triggers with MySQL?
That would seem to me to ve a reason not to allow cascade update