Wednesday, December 11, 2019

assorted strange SQL

  1. LEAD and LAG are esoteric and obscure. They are like ROW_NUMBER() only they get either the page before or the page after what ROW_NUMBER() would get.
  2. The whole SELECT INTO trick in T-SQL to SELECT into a temp table that is spun up right then may also be used to just make a new, regular table!
  3. When a table variable is passed to a stored procedure (in T-SQL) it is a TVP (table-valued parameter).
  4. CTEs in T-SQL use In-Memory memory management while table variables may use the Memory-Optimized Table approach to memory. I don't really understand this stuff. The MOT approach has a divide between Durable and Non-Durable and I don't understand that yet either.
  5. Not every reserved keyword in T-SQL must be wrapped in brackets to be used as a name. This only applies to the keywords which could otherwise be keywords (without error) in the SQL statement at hand.

No comments:

Post a Comment