Home Menu
  • Home
  • About – Tomas Lind
  • Contact
  • Blog Series
    • Technical Analysis (TA)
  • T-SQL
    • T-SQL Scripts
    • Templates
  • Consulting Services
  • Software
Tomas Lind

Posts in Category ‘T-SQL’

  • 2017/07/18
  • 4 comments

The T-SQL Merge statement

You have a table A with new data, and a table B with old data. How do you make sure table B is refreshed with data from table A? You want to insert new records, update existing records and to … Read more →

  • Posted in: Excel, T-SQL
  • 2016/12/08
  • 0 comments

Identity columns that are about to overflow

Identity columns are widely used as primary key columns in SQL Server tables. They can be one of the data types TINYINT, SMALLINT, INT, BIGINT, NUMERIC or DECIMAL. Each of these data types has an upper limit and when that … Read more →

  • Posted in: T-SQL, Tips & Tricks
  • 2016/05/25
  • 0 comments

Split strings to columns

A short demo on how to split strings with delimiters into columns.

  • Posted in: T-SQL, Tips & Tricks
  • 2015/09/14
  • 4 comments

Create XML with T-SQL function FOR XML

Some time ago I demonstrated how to use XQuery to map a hierarchical XML document into parent- child relational tables. You can find that article here. The other way around, (to create create XML with T-SQL), is a lot easier … Read more →

  • Posted in: T-SQL, XML
  • 2015/07/07
  • 2 comments

How to fill in gaps in time series

In some cases it is necessary to have an unbroken time series, for instance to have all days during a year. But what if some days are missing from the data? How can we fill in gaps in time series?

  • Posted in: T-SQL, Tips & Tricks
  • 2015/06/26
  • 19 comments

Sending HTML tables in mail from SQL Server

This post contains a template for sending HTML tables via mail in T-SQL. A prerequisite is that you have created a Database Mail Profile. If you don’t have an email server available, you can use Gmail instead as demonstrated here.

  • Posted in: Database Mail, T-SQL, Tips & Tricks
  • 2014/12/10
  • 1 comment

Mass editing of SQL Server objects

Ever had the need to replace a piece of code in multiple SQL Server objects (Stored Procedure, Trigger, Function or Views)? Here’s a method to search for a string in all objects, replace it with some other code, and to … Read more →

  • Posted in: Dynamic Management Objects, T-SQL, Tips & Tricks
  • 2014/12/03
  • 4 comments

A T-SQL WHILE loop demonstration with BREAK and CONTINUE

Just a short blog post to demonstrate the use of a WHILE loop in T-SQL, together with the BREAK and CONTINUE statements.

  • Posted in: T-SQL
  • 2014/11/26
  • 1 comment

T-SQL Pivot and Unpivot

A simple demonstration of the Pivot and Unpivot functions in T-SQL.

  • Posted in: T-SQL
  • 2014/08/16
  • 0 comments

Max or min value from a set of columns

The min and max aggregates in SQL Server are normally used to work over rows, getting the max or min value from a set of rows. But what if you want to get the max or min value from a … Read more →

  • Posted in: T-SQL, Tips & Tricks
← Older entries

confided data manager

Get compliant with the GDPR!


High Coast Database Solutions

High Coast Database Solutions

sql server consulting services


Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Top Posts & Pages

  • How to align columns in Notepad++
  • Manual failover in a SQL Server cluster
  • Export data from Excel to SQL Server
  • List SQL server roles by users
  • CDC Cleanup job

Recent Posts

  • Get element max value from folder with XML files
  • Dynamic Data Masking (DDM) – Mask query results
  • The T-SQL Merge statement
  • From SQL Server to MSMQ using PowerShell
  • Identity columns that are about to overflow

Archives

Categories

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Instagram

This error message is only visible to WordPress admins

Error: No connected account.

Please go to the Instagram Feed settings page to connect an account.

  • © 2022 Tomas Lind
  • Proudly powered by WordPress
  • Theme: Waipoua by Elmastudio
Top ↑