We do a lot of code reviews and the use of SELECT DISTINCT always comes up as its picked up by many of the static code analysis tools as a known scalability and performance risk. The common question is “Why should I avoid distinct” and “How can I avoid it” During a performance review we … Continue reading TSQL Best Practice – Avoid use of DISTINCT
Tag: TSQL
Here is some handy TSQL to determine all the FK relationships in a database. The basic ideas is we can use this meta data to automatically determine if a form should have a Combo Box rendered instead of a textbox. -- List all Foreign key Relationships in User Tables SELECT so.name as ForeignTableName, sc.name as … Continue reading TSQL to determine all FK’s in a database