T-SQL: LEFT (RIGHT) JOIN and WHERE clause
Keep it simple :-)
Keep it simple :-)
Just a quick note: pay attention when you hash different data types. The result is different. Also the lower/upper case: Keep it simple :-)
The MERGE statement was introduced in SQL Server 2008 and the developers embraced it immediately. Later a feedback came and the statement was criticized as not very efficient. Aaron Bertrand collected some links about this here. MERGE statement anatomy The MERGE statement joins ‘source’ and ‘target’ tables and runs INSERT, […]
Set-based Database Development As database developer, we need to switch our mindsets to “Set-based thinking”. In simple words we need to manipulate the data as a “set”. An example of set-based database development is: JOIN tables Aggregate the result Calculate the portion (%) of a row to the total of […]
XML is dead, long live JSON! Even before i knew JSON, i thought “XML contains more metadata than data”. Today in my new development, i prefer JSON and avoid using XML, but in some cases we need to fight with XML too. In this quick example i show how to […]
Entity-Atribute-Value (EAV) data model gives us the flexibility to store the data in a way that we have dynamic number of: tables columns in the simplest EAV we have 3 tables: Entity Attribute Value To simplify the understanding of the model we declare: Table Entity holds the list of the […]
The PDF version of the book Learn Microsoft® SQL Server® Intuitively. Transact-SQL: The Solid Basics can be found here. The source code can be downloaded here. Keep it simple :-)
Running total in groups: Running text replace in groups: Get the result: Keep it simple :-)
I needed to quote an identifier (a column name) with “<“. I checked the documentation for the build-in function QUOTENAME() and I did not find the information that I need. Here is a quick T-SQL to show which characters we can use as a second argument of the function.
In the last posts we played with Change Tracking (CT): T-SQL: Change Tracking – What is this and how it works T-SQL: Change Tracking Retention Period – How Long the Changes are Kept? Let’s execute few queries and see what do we have after the retention period expires.