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 13 (126 total posts)
  • 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
  • Denali Enhancement–Duplicate Key Error Message

    When I was editing my chapter on implementing a database, I noticed a really nice improvement in the error message I had from the previous edition of the book. Instead of just telling me that there was a value in my modification statement that duplicated an existing value (or multiple values affected by the statement), it told me the duplicated ...
    Posted to Louis Davidson (Weblog) by drsql on July 14, 2011
  • Debunking Kimball Effective Dates part 2 – Windowing Functions

    Reigniting the [SCDEndDate] debate In November 2009 I wrote a blog post entitled Debunking Kimball Effective Dates where I stated that I was against the Kimball-recommended practice of maintaining a StartDate & EndDate value for every record in a type 2 slowly changing dimension (SCD) table (i.e. the values highlighted in blue in the ...
    Posted to Jamie Thomson (Weblog) by jamiet on July 13, 2011
  • Security – how to assign rights to database objects

    A few days ago my team mate asked me to check out why one of the logins doesn’t have right to execute to a few stored procedures. Allegedly it had the right before. After a few minutes of digging in the source control it turned out that these procedures were scripted with explicit EXECUTE rights to them. However, some later updates to the code did ...
    Posted to Piotr Rodak (Weblog) by rodak.p@gmail.com on April 10, 2011
« First ... < Previous 5 6 7 8 9 Next > ... Last »
Privacy Statement