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 1 of 24 (239 total posts)
  • How to calculate barcode check-digit using T-SQL language

    Introduction In order to scale, it's imperative that companies stay ahead of competition. So how can they identify, store, manage and deliver goods to customers efficiently? The answer is: Barcode! A barcode is the graphical representation of a sequence of numbers and other symbols. The representation is made by lines (bars) and spaces. A barcode ...
    Posted to Sergio Govoni (Weblog) by Sergio Govoni on June 23, 2017
  • Utility to temporarily drop FOREIGN KEY constraints on a set of tables

    I was working on a database a few weeks back (maybe longer, I am kind of busy with several projects right now), and I wanted to truncate a set of tables. There was one central table, and 8 tables related by a FOREIGN KEY constraint. The central table had 6 million rows, and a few of the other tables 20+ million. TRUNCATE is amazingly fast,and when ...
    Posted to Louis Davidson (Weblog) by drsql on June 15, 2017
  • Utility to script a FOREIGN KEY Constraint

    Note: Amended to include the word include in the first Note (I am a terrible editor of my own writing!) and to fix a bug in the code with a misplaced parenthesis Note: Amended to include cascading and NOT FOR REPLICATION. As noted in my previous post, I am in the middle of building a utility (for work, and for my next SQLBLOG post), that ...
    Posted to Louis Davidson (Weblog) by drsql on May 24, 2017
  • Creating FOREIGN KEY constraints as enabled, trusted, non-trusted, and/or disabled

    I am in the middle of building a utility (for work, and for my next SQLBLOG post), that will help when you need to drop the foreign key constraints on a table, but then replace them without having to save off the script manually. Part of the process is to generate the script for the foreign key constraint, so the first thing I need to do is to ...
    Posted to Louis Davidson (Weblog) by drsql on May 7, 2017
  • Quick Regions in SQL Server Management Studio (SSMS)

    There are a few tools and add-ins that support the creation of “regions” in T-SQL code. SQL Server Management Studio (SSMS) supports one way to separate sections of long-ish T-SQL scripts natively, by using begin/end: To demonstrate, start with a snippet of T-SQL that includes begin/end: If you click on the “-“ highlighted above, the code will ...
    Posted to Andy Leonard (Weblog) by andyleonard on April 14, 2017
  • SQL Server 2016 Developer’s Guide

    I can proudly announce that it is already possible to preorder the SQL Server 2016 Developer’s Guide book (https://www.amazon.com/SQL-Server-2016-Developers-Guide-ebook/dp/B01MS5L01Q/ref=sr_1_20?ie=UTF8&qid=1488533994&sr=8-20&keywords=SQL+Server+2016). This is the 14th book I authored or coauthored This time, my coauthors are Miloš ...
    Posted to Dejan Sarka (Weblog) by Dejan Sarka on March 3, 2017
  • A new (to me, and possibly you) SSMS feature - Query Plan Comparing

    Wow, Microsoft has really changed in culture recently. This new rapid release cycle for SSMS is seemingly paying dividends in a major way. In a recent build of SSMS (okay, perhaps not "recent", more like this October of 2015, according to this blog by the MSSQL Tiger Team:), they added the ability to compare query plans. I tried it on a ...
    Posted to Louis Davidson (Weblog) by drsql on January 26, 2017
  • Saving a Few Lines of Code by Performing Multiple Operations in a Single Command

    I was in Mike Byrd's session on in-memory technologies the other day and I saw him do something I had never seen and it prompted me to write this blog today. It has nothing to do with in-memory, as the title notes, but has to do with stacking commands in a statement I had not seen before. This was SET STATISTICS. For my entire career, I have put ...
    Posted to Louis Davidson (Weblog) by drsql on January 19, 2017
  • T-SQL Tuesday #86 My all-time favorite personal SQL Server Enhancement Request: Automatically maintained columns

    I have heard the name T-SQL Tuesday for (like,) ever; but I have always been so into my own bundle of insanity that never took the time to figure out what it is. This changes today because I read a blog on Adam Machanic's (@adammachanic) blog that outlined the rules (here) and I have been keen to get back to blogging regularly. When I saw what ...
    Posted to Louis Davidson (Weblog) by drsql on January 10, 2017
  • Curious - How does STRING_SPLIT (2016) handle empty/NULL Input?

    If you haven't seen STRING_SPLIT, it is pretty awesome, and something we have all been working with for many years, which you can read about in Erland Sommarskog's great article here along with many other concepts involved in sending in a set of data to a stored procedure. As a quick starting example, consider the string of characters: A,B,C;D. ...
    Posted to Louis Davidson (Weblog) by drsql on November 22, 2016
1 2 3 4 5 Next > ... Last »
Privacy Statement