-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Quantum Leap

Solomon Rutzky has been working with computers since the mid 1980s. He has experience with a variety of hardware platforms, OSs, programming languages, and RDBMSs. He has focused on SQL Server since 2002, and has written articles for SQL Server Central, including the Stairway to SQLCLR series, and Simple Talk. Solomon is the founder / owner of Sql Quantum Lift, and is the creator of the popular SQL# SQLCLR library. He answers questions on a few StackExchange sites and Ask.SqlServerCentral.com.

Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part B of 2: “Rabbit”)

Welcome back! Previously, on “Who’s Collation is it Anyway?”, due to statements made in the Microsoft documentation for “Search Conditions” related to Code Page conversions, we started looking at what happens when VARCHAR data (mainly string literals that are not prefixed with a capital-“N”) is used in a Database… Read more

1 comments, 160 reads

Posted in SQL Quantum Leap on 11 December 2017

Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part A of 2: “Duck”)

So, the actual question is a bit more specific than would reasonably fit into a title, and it is:

In a WHERE condition (in Microsoft SQL Server, if that’s not obvious), when a string constant containing Unicode characters but not prefixed with a capital-N is compared to a column,…

Read more

2 comments, 135 reads

Posted in SQL Quantum Leap on 8 December 2017

Sessions, Temporary Objects, and the Afterlife

For thousands of years theologians have offered various thoughts on the question of what happens when we die. Does some part of who we are come back to start over again? Do we go to some other place? Is “the end” simply that: the end, in an absolute sense? When… Read more

1 comments, 1,187 reads

Posted in SQL Quantum Leap on 20 November 2017

Line-Continuation in T-SQL

Some (or maybe most?) languages and operating system command shells allow for breaking up long lines into multiple lines (i.e. lines separated by hitting Enter / Return). This is accomplished by ending a line with a particular character that indicates that the line is not ending. For operating system… Read more

1 comments, 2,264 reads

Posted in SQL Quantum Leap on 27 October 2017

All New Collations in SQL Server 2017 Implicitly Support Supplementary Characters

As I was testing whether or not the new “Variation Selector Sensitive” ( _VSS ) Collations in SQL Server 2017 would assist in the following question on DBA.StackExchange:

SELECT query: filter unable to distinguish between two different characters

I ran into what initially looked to be an unfortunate situation. I… Read more

1 comments, 916 reads

Posted in SQL Quantum Leap on 16 October 2017

SQLCLR vs. SQL Server 2017, Part 6: “Trusted Assemblies” – Whitelisted Assemblies can’t do Module Signing

“Trusted Assemblies”, a new feature starting in SQL Server 2017, is a means of whitelisting Assemblies that one feels pose no threat, and can be created (and used) without needing to be a) signed and b) have a corresponding signature-based Login that has been granted the UNSAFE ASSEMBLY permission. In… Read more

3 comments, 900 reads

Posted in SQL Quantum Leap on 29 September 2017

Clustered Index Uniquifier Existence and Size

In SQL Server, each and every row in a table needs to be accessible by itself, whether or not you declare a Primary Key. Even if you had 1 million rows of just the letter “A” in a one-column table, SQL Server still needs to distinguish between each of those… Read more

2 comments, 62 reads

Posted in SQL Quantum Leap on 19 September 2017

SQLCLR vs. SQL Server 2017, Part 5: “Trusted Assemblies” – Valid Use Cases?

In the previous post in this series on SQLCLR in SQL Server 2017 — Part 4: “Trusted Assemblies” – The Disappointment — we looked at what the “Trusted Assemblies” feature is, what it meant to do, the problems with it, and what the better and more appropriate approach is. “Trusted… Read more

1 comments, 61 reads

Posted in SQL Quantum Leap on 4 September 2017

SQLCLR vs. SQL Server 2017, Part 4: “Trusted Assemblies” – The Disappointment

Recap

Before we look at “Trusted Assemblies”, let’s take a moment to review the context of the situation. First, the “Good”: SQL Server 2017 introduces many awesome features including Linux as a platform, adaptive query processing, interleaved execution for Multi-statement TVFs, and a lot more. Next, the “Bad”: SQL Server… Read more

4 comments, 110 reads

Posted in SQL Quantum Leap on 28 August 2017

SQLCLR vs. SQL Server 2017, Part 3: “CLR strict security” – Solution 2

Welcome back, everyone. In the previous post in this series, I explained how to work within the new SQLCLR security restriction in SQL Server 2017 (i.e. that all Assemblies need to be signed and have a corresponding Login that has been granted the UNSAFE ASSEMBLY permission). That approach is 22… Read more

0 comments, 73 reads

Posted in SQL Quantum Leap on 16 August 2017

SQLCLR vs. SQL Server 2017, Part 2: “CLR strict security” – Solution 1

As mentioned in Part 1 of this “SQLCLR vs. SQL Server 2017” series, the new clr strict security server-level configuration option requires that in order to create any Assembly, even a SAFE one, it must be signed (by a Certificate or Strong Name Key), and there must already exist a… Read more

9 comments, 166 reads

Posted in SQL Quantum Leap on 9 August 2017

SQLCLR vs. SQL Server 2017, Part 1: “CLR strict security” – The Problem

The Good, the Bad, and the Ugle¯e¯ (need to avoid copyright infringement )

SQL Server 2017 is soon to be officially released (i.e. RTM) and there are some impressive changes, with some being impressively good, and some being impressively bad.

The Good

Some amazingly good changes are: Linux as a… Read more

2 comments, 364 reads

Posted in SQL Quantum Leap on 7 August 2017

SSMS Tip #2: Shortcut Keys for SQLCMD Mode, Open Containing Folder, Copy Full Path, etc

In SQL Server Management Studio (SSMS), there are a lot of options and functions. In fact, there are so many that you might never see / encounter quite a few of them. Part of the issue is that there are four locations to find these options and functions. The four… Read more

0 comments, 51 reads

Posted in SQL Quantum Leap on 20 July 2017

SSMS Tip #1: Annotations and Map Mode for Vertical Scroll Bar

SQL Server Management Studio (SSMS) for SQL Server 2016 added some interesting enhancements for the vertical scroll bar: Map Mode and Annotations. Map mode (with Source Overview enabled) changes the vertical scroll bar into a simplistic graphical representation of the entire script (as opposed to the solid grey bar that… Read more

0 comments, 41 reads

Posted in SQL Quantum Leap on 17 July 2017

No, Binary Collations are not Case-Sensitive

Quite often people will use, or will recommend using, a binary Collation (one ending in “_BIN” or “_BIN2“) when wanting to do a case-sensitive operation. While in many cases it appears to behave as expected, it is best to not use a binary Collation for this… Read more

1 comments, 45 reads

Posted in SQL Quantum Leap on 13 July 2017

Impact on Indexes When Mixing VARCHAR and NVARCHAR Types

You may have heard, or read, that you should not mix VARCHAR and NVARCHAR datatypes, especially when one of them is a JOIN or WHERE predicate / condition, as doing so will invalidate indexes. While it is always best to have all datatypes be the same for a particular operation… Read more

1 comments, 51 reads

Posted in SQL Quantum Leap on 10 July 2017