The four basic SQL statements are SELECT, UPDATE, INSERT and DELETE. A short note on what each one does, with a link to my one page FAQ sheet for full syntax.
SQL SERVER – SQL SERVER – Comparison : Similarity and Difference #TempTable vs @TempVariable – Part 2
Can a temp table have indexes? Yes. In Part 2 of #TempTable vs @TempVariable, I explain how temporary table indexes live in TempDB and when they help.
Readable IDs: A Bounded Computed Invoice Number
Create readable IDs with a computed invoice number while retaining the numeric key. Enforce the six-digit domain and plan format changes before growth.
SQL SERVER – Function Property – Deterministic or Non-Deterministic
How do you tell if a user defined function is deterministic or non-deterministic? One OBJECTPROPERTY call with IsDeterministic gives you the answer.
XQuery distinct-values: Deduplicate Atomic Values, Not Nodes
XQuery distinct-values removes repeated atomic values rather than selecting representative source nodes. I rebuild a small sorted XML result from repeated text. The example also keeps an empty document in view.
SQL SERVER – 2005 – Find Tables With Foreign Key Constraint in Database – Part 2
Joffery improved my script to find tables with foreign key constraint in a database, adding the ON UPDATE and ON DELETE rules and a little ordering.







