Posts

Show me everything

Image
Pixabay / Tumisu Steve Jones ( b | t ) turned the light on and started the October party for T-SQL enjoyers. The topic: to write about producing SQL dynamically in some way. That is T-SQL Tuesday #155 –The Dynamic Code Invitation . Let's tell the story! Once upon a time, I got the client's requirements for the report application, coming from the darkest SQL developer's dreams. Below are the main elements of this nightmare: Write a single SELECT query template, without batches, without stored procedures, etc. - a raw query, with a dynamic number of columns (from 10 to ca. 400), which can dynamically include a different number of tables (at least 10, up to ca. 30) in JOIN operations, according to parameters, which number is also dynamic (up to ca. 400), and the query is using a simple template syntax, supported by the report application, with markups formatted as SQL comments, the template syntax allows grouping parameters in sections, and these sect...

Less T, more SQL

Image
The new SQL Server is coming soon . Fortunately, on the day of release, there will be more novelties than on the last iPhone release, so we shouldn't be disappointed. As a fan of pure SQL in T-SQL dialect, I am particularly glad to see IS [NOT] DISTINCT FROM predicate in our toolbox. I remember my training sessions for beginners when I showed examples of set logic fundamentals in T-SQL and the feeling of participation in a magic trick. I remember pieces of production code, when using pure SQL spells introduced simplicity and elegance into the product. The declarative side of T-SQL makes my programming experience so different, and so intellectually satisfying... It's like touching something ethereal or spiritual. Using imperative logic to achieve a goal - because of performance issues, time pressure, whatever - for me as a SQL developer, rarely comes without a fight. I know - there are loops, ifs, and counters under the hood, and we need indexes, but using pure SQL, f...

Be ready to change your mind

Image
Tell us about the experiences, the code, the posts that inspired you, and all the gory details in between. And what is it that makes you so passionate about this topic that "It Depends" gets tossed out the window? Pull out your soapbox and tell us all about it - this is the invitation of Deborah Melkin for T-SQL Tuesday #152 - It Depends . Although "the sentence" is not mentioned on the list given by Deborah, I want to write about one sentence, which unexpectedly terminated a long episode in my professional career as a programmer, and which builds my main, archetypical answer including "it depends". This sentence comes from The Clean Code Blog , the post's title is: The Clean Architecture , and the sentence is: The database is a detail. Before I read this, I was diving deeply and broadly into Books Online Ocean, SQL Server Central Sea, Simple Talk Lake, SQL Server Tips Pond... I spent more than 10 years on understanding SQL Server database detai...

Context-Driven Coding Standards

Image
T-SQL Tuesday is the brainchild of Adam Machanic. It is a monthly blog party on the second Tuesday of each month. Everyone is welcome to participate. The current invitation (June 2022) is for T-SQL Tuesday #151: Coding Standards . Prologue Before I write what I think about the T-SQL coding rules today, I would like to confess my greatest and ongoing sympathy for this language. I created software with over 50 languages during my life, but none has shaped my feeling and understanding of good code as much as T-SQL. This seems to be strange because so much cannot be done comfortably with T-SQL, and so much cannot be done meaningfully with it. So, as a programmer, shouldn't I dream of a language that will give me more possibilities to express intuition? Maybe I should, but as Gilbert Keith Chesterton wrote beautifully somewhere, if God had an infinity to create the world, he would probably never create it, but because he gave himself seven days...