THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » T-SQL   (RSS)
Showing page 7 of 14 (139 total posts)
  • Use VALUES clause to get the maximum value from some columns [SQL Server, T-SQL]

    My ex-colleague Paul Mcmillan pointed me at a thread on Stack Overflow that demonstrated a neat T-SQL trick to get the maximum value from a collection of columns in a row. Paul had never seen it before and neither had I so I figure one or two of you out there might learn something from it too. In short you can use the VALUES clause to effectively ...
    Posted to Jamie Thomson (Weblog) by jamiet on January 20, 2012
  • Server level permissions for developers–why you should read books

    It is quite difficult recently for me to find some time to write a new post, so I don’t seem to be leading the rankings of the most frequent bloggers. I rarely recently have opportunity to lay my hands on the code too, so natural sources of ‘inspiration’ are less often. Hopefully this will change in 2012 and I will have more opportunities to write ...
    Posted to Piotr Rodak (Weblog) by rodak.p@gmail.com on January 1, 2012
  • T-SQL Tuesday 24: Ode to Composable Code

    I love the T-SQL Tuesday tradition, started by Adam Machanic and hosted this month by Brad Shulz. I am a little pressed for time this month, so today’s post is a short ode to how I love saving time with Composable Code in SQL. Composability is one of the very best features of SQL, but sometimes gets picked on due to both real and imaginary ...
    Posted to Merrill Aldrich (Weblog) by merrillaldrich on November 8, 2011
  • Planning my Louisville SQL Saturday Presentation

    So it is Tuesday night, just a few days until my presentation entitled What Counts For A DBA and I am still not completely sure exactly what is going to go on. In fact, I don’t exactly plan to know what is going on until the presentation is over.  On paper it seems like a simple idea. I am going to use 9 of the topics I have posted on my ...
    Posted to Louis Davidson (Weblog) by drsql on October 25, 2011
  • Delete all data from a database

    Sometimes I use this blog to share scripts that I know I'm going to need at some point in the future, this is one of those times. The script below will remove all data from a database while respecting/preserving all foreign key constraints - very useful in a development or test environment if you want to get back to a ''vanilla'' snapshot of your ...
    Posted to Jamie Thomson (Weblog) by jamiet on September 19, 2011
  • How to Run a Series of T-SQL Scripts in a Specific Order

    Another post in the handy-but-not-bleeding-edge category. In the past few months I’ve seen a number of folks struggle with how to reliably/repeatedly execute a heap of T-SQL Script files, in order. One could certainly argue about why there’s the need for piles of scripts in text files, but that’s outside the scope of this post – today I want to ...
    Posted to Merrill Aldrich (Weblog) by merrillaldrich on September 12, 2011
  • [T-SQL Tuesday] Some code is born crap, some code achieves crapness and some code has crapness thrust upon it!

    I recently returned to a client at which I last worked back in 2006 and, as you might imagine, that gives me ample material for a blog post dedicated to Crap Code; conveniently the subject of the latest T-SQL Tuesday. I first worked for this client back in 2004 and that is significant because back then we were writing code on SQL Server 2000. Ah, ...
    Posted to Jamie Thomson (Weblog) by jamiet on August 10, 2011
  • On the typeof() campaign trail

    Given a table: CREATE TABLE [person] (  [id] INT IDENTITY(1,1) ,  [name] VARCHAR(100) ,  [age] INT); How nice would it be to be able to do something like this inside your stored procedures?: DECLARE @person TABLE (  [name] typeof([person].[name]) ,  [age] typeof([person].[age])); Or, perhaps, ...
    Posted to Jamie Thomson (Weblog) by jamiet on August 10, 2011
  • SQL_VARIANT_PROPERTY function

    I learnt something about T-SQL today that I never knew and I figure I’m not the only one so it might be worth sharing what I learnt; namely, I discovered the SQL_VARIANT_PROPERTY function. It all started when going over a piece of code that I recently inherited, here is an abbreviated version of that code in order to demonstrate the ...
    Posted to Jamie Thomson (Weblog) by jamiet on August 3, 2011
  • OUTPUT clause and windowing functions

    A few days ago I was asked a question how to remove duplicates from a table. As usually in such cases, the duplicate values were related only to several columns, not all of them. So classical approach, to copy distinct data into temp table, truncate the table with duplicates and then copy the data back wouldn’t work. In such cases I find one of ...
    Posted to Piotr Rodak (Weblog) by rodak.p@gmail.com on July 31, 2011
« First ... < Previous 5 6 7 8 9 Next > ... Last »
Privacy Statement