How to Find the Collation in SQL Server (T-SQL)

Collation can be specified at the server level, database level, column level, expression level, and the identifier level. A different method is required for each of these.

Server Level Collation

Here’s how to find the server level collation:

SELECT CONVERT (varchar, SERVERPROPERTY('collation')) AS 'Server Collation';

This returns the collation like this:

Server Collation
----------------------------
SQL_Latin1_General_CP1_CI_AS

Continue reading

How to Check your SQL Server Version

SQL Server, or more specifically, Transact-SQL, includes a number of built in functions, including the @@version scalar function. The @@version function is a configuration function, which returns system and build information for the current installation of SQL Server. You can run this function at any time to find out which version of SQL Server you’re using.

Here’s how:

SELECT @@version;

When running that in a command line interface, you might see results that look like this:

Microsoft SQL Server 2017 (RTM-CU6) (KB4101464) - 14.0.3025.34 (X64) 
	Apr  9 2018 18:00:41 
	Copyright (C) 2017 Microsoft Corporation
	Developer Edition (64-bit) on Linux (Ubuntu 16.04.4 LTS)

1 row(s) returned

Executed in 1 ms

Continue reading

How to Return a List of Available Collations in PostgreSQL

In PostgreSQL, we can use the pg_collation catalog to get a list of the available collations. Another way to do it is to use the \dOS command.

Using the first method, we can run the following statement to return a list of available collations in PostgreSQL:

SELECT * 
FROM pg_collation;

These collations are mappings from an SQL name to operating system locale categories.

Continue reading

New Features in SQL Server 2017 (Database Engine)

Below is a list of new features added in the SQL Server 2017 database engine.

Support for Linux and Mac

For the first time since SQL Server was introduced back in 1989, SQL Server is available on Linux (Red Hat, SUSE, Ubuntu) and Docker.  This means you can also install SQL Server 2017 on a Mac (by using a Linux image in a Docker container).

The initial release of SQL Server 2017 for Linux doesn’t include the full set of features available in the Windows release, but it’s a good start.  Microsoft has stated that it is working on including more features in future releases.

For now, here’s a list of the main features available in SQL Server 2017 for Linux (as of its initial release).
Continue reading

SQL Server 2017: Available Features on Linux

SQL Server 2017 is available on Linux and Docker (which means that it’s also available on Mac). This is the first time SQL Server has been available on a non-Windows platform.

However, not all SQL Server features are available on Linux (at least, not in the initial release).

The following table outlines the main features available in the initial release of SQL Server 2017 on Linux. These are the same features available if you are running SQL Server on a Mac (given the Mac runs SQL Server 2017 via a Linux Docker container).
Continue reading