-->
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.

SQLCLR vs SQL Server 2017, Part 9: Does PERMISSION_SET Still Matter, or is Everything Now UNSAFE?


(last updated: 2018-11-01 @ 00:50 EDT / 2018-11-01 @ 04:50 UTC )

SQL Server 2017 introduced a new security restriction for SQLCLR in the form of a system configuration option named, “CLR strict security”. So far, this series – SQLCLR vs SQL Server 2017 – has mostly focused on the… Read more

2 comments, 2,864 reads

Posted in SQL Quantum Leap on 31 October 2018

Native UTF-8 Support in SQL Server 2019: Savior or False Prophet?


(last updated: 2018-12-13 @ 09:35 EST / 2018-12-13 @ 14:35 UTC )

(NOTE: For recent update, please see “Update for CTP 2.1” section; will update soon for CTP 2.2)

For some time now, many of us have struggled with data that is mostly standard US-English /… Read more

4 comments, 1,217 reads

Posted in SQL Quantum Leap on 28 September 2018

SQLCLR vs SQL Server 2017, Part 8: Is SQLCLR Deprecated in Favor of Python or R (sp_execute_external_script)?

With the additional (and annoying) configuration step required to get SQLCLR Assemblies to load starting in SQL Server 2017, some people have been wondering what is going on with SQLCLR. Considering that this new restriction is the only real change to SQLCLR since SQL Server 2012 (three versions ago), then… Read more

3 comments, 2,452 reads

Posted in SQL Quantum Leap on 9 August 2018

Changing the Collation of the Instance, the Databases, and All Columns in All User Databases: What Could Possibly Go Wrong?

Demystifying What “sqlservr -q” Actually Does

(last updated on 2018-08-02)

For various reasons, people sometimes find themselves in the unfortunate (and unenviable) situation of having an Instance of SQL Server configured with the wrong Collation. This can often lead to unexpected errors and/or sorting and comparison behavior.

People sometimes try… Read more

11 comments, 3,189 reads

Posted in SQL Quantum Leap on 12 June 2018

Enable Group Policy Editor (gpedit.msc) on Windows 10 Home Edition

Occassionally I want / need to change a Windows setting that is not configurable via Control Panel or Settings. For example:

The instructions usually require using Group Policy Editor (gpedit.msc). Unfortunately, I am using Microsoft Windows 10… Read more

10 comments, 920 reads

Posted in SQL Quantum Leap on 6 June 2018

The Uni-Code: The Search for the True List of Valid Characters for T-SQL Identifiers, Part 3 of 2 (Delimited Identifiers)


(last updated: 2018-04-26)

This is Part 3 of 2. Yes, you read that correctly. You see, way back at the very beginning (i.e. in Part 1), I mentioned:

…based on my experiences, it seems that more often than not, doing an exhaustive test results in a slightly different answer…

Read more

1 comments, 171 reads

Posted in SQL Quantum Leap on 16 April 2018

Why Doesn’t CONTEXT_INFO() Return the Exact Value Set by SET CONTEXT_INFO?

(last updated: 2018-04-28)

Let’s say that you execute the following T-SQL:

SET CONTEXT_INFO 1234;
SELECT CONVERT(INT, CONTEXT_INFO());

The result will be:

0

Why is that? The value passed in is an INT, which is only 4 bytes, yet CONTEXT_INFO can hold up to 128 bytes. Certainly 4 can fit… Read more

3 comments, 948 reads

Posted in SQL Quantum Leap on 9 April 2018

What’s in a Name?: Inside the Wacky World of T-SQL Identifiers


(last updated: 2018-04-28)

Today we are going to take a look into an area that you probably are thinking has very little to see: T-SQL Identifiers (i.e. entity names). Most of the time the rules governing how you name things in SQL Server are pretty simple, but there are several… Read more

1 comments, 2,746 reads

Posted in SQL Quantum Leap on 9 April 2018

The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 2


(last updated: 2018-04-28)

Recap

In Part 1 of this 2 part series, I started with the loose definition in Microsoft’s documentation for “Database Identifiers“, which states (slightly edited for readability):

Rules for Regular Identifiers

  1. The first character must be one of the following:

    • A letter as defined by…

Read more

3 comments, 1,813 reads

Posted in SQL Quantum Leap on 6 April 2018

The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 1


(last updated: 2018-04-09)

In answering a recent question on DBA.StackExchange related to why some characters work for parameter names and others do not ( How to create Unicode stored procedure parameter names ), I pointed out that the documentation for Database Identifiers states (slightly edited for readability):

Rules for Regular…

Read more

4 comments, 420 reads

Posted in SQL Quantum Leap on 3 April 2018

Safely and Easily Use High-Level Permissions Without Granting Them to Anyone: Database-level

Part of having good security is giving users the fewest / least permissions possible in order to execute the code. However, we always seem to find ourselves needing to allow someone to execute something that requires one or two higher-level permissions. Yet, in order to allow for just one extra… Read more

1 comments, 2,205 reads

Posted in SQL Quantum Leap on 5 March 2018

SQLCLR vs. SQL Server 2012 & 2014 & 2016, Part 7: “CLR strict security” – The Problem Continues … in the Past (Wait, What?!?)

If the new “CLR strict security” Server-level configuration option in SQL Server 2017 hasn’t caused enough confusion and pain, then, as Eagle Man says, “I’ve got something for you”. You can now enable this super-fun setting in SQL Server 2012, 2014, and 2016. Why would anyone (intentionally) do this?… Read more

1 comments, 1,010 reads

Posted in SQL Quantum Leap on 23 February 2018

Safely and Easily Use High-Level Permissions Without Granting Them to Anyone: Server-level

Part of having good security is giving users the fewest / least permissions possible in order to execute the code. However, we always seem to find ourselves needing to allow someone to execute something that requires one or two higher-level permissions. Yet, in order to allow for just one extra… Read more

6 comments, 2,497 reads

Posted in SQL Quantum Leap on 15 February 2018

SQL# Version 4.1 is released!!

Version 4.1 of SQL# has just been released!

New functionality available only in Full version

  1. Sys_LockResource
    • Returns the name of the specified Lock Resource given the Type, Subtype, DatabaseID, Description, and AssociatedEntityID.
    • Works similarly to the OBJECT_NAME and OBJECT_SCHEMA_NAME built-in functions in that you do…

Read more

1 comments, 1,252 reads

Posted in SQL Quantum Leap on 12 February 2018

Server Audit Mystery 2: Filtering action_id gets Error Msg 25713

This post is, for the most part, a continuation of Server Audit Mystery 1: Filtering class_type gets Error Msg 25713. In that post I was trying to filter on the class_type field / predicate source (i.e. the object, or whatever, that the event is on). The tricky part was… Read more

0 comments, 2,106 reads

Posted in SQL Quantum Leap on 30 January 2018

Will GDPR cause a “Database Run”?

What is GDPR, everyone’s (current) favorite acronym? It stands for “General Data Protection Regulation” and is an act / law / set of laws that governs the collection, retention, and use of personal information for EU (European Union) and UK citizens. It’s the topic “flavor of the month” due to… Read more

0 comments, 2,337 reads

Posted in SQL Quantum Leap on 23 January 2018

Server Audit Mystery 1: Filtering class_type gets Error Msg 25713

The other day I ran into an odd problem trying to answer the following question on DBA.StackExchange:

How to filter out Scalar Valued Function usage from SQL Server Audit Data?

According to the documentation for CREATE SERVER AUDIT, I should be able to add a WHERE clause (starting in… Read more

2 comments, 1,214 reads

Posted in SQL Quantum Leap on 22 January 2018

Stored Procedure / Function / View / Trigger Definitions Can Be Wrong, Even If sp_rename Was Never Used

SQL Server stores the full definition of certain T-SQL objects — Stored Procedures, Functions, Views, and Triggers — in their original form, as they are being created. In fact, the entire batch containing the CREATE statement is stored, which is quite likely why no other statements are allowed in a… Read more

2 comments, 657 reads

Posted in SQL Quantum Leap on 9 January 2018

PLEASE, Please, please Stop Using Impersonation, TRUSTWORTHY, and Cross-DB Ownership Chaining

(last updated: 2018-03-27)

Despite features added in SQL Server 2005 (yes, 2005!) that allow for very flexible, granular, and robust security, it is still quite common for people to be using the older and/or riskier mechanisms of temporarily granting additional privileges.

What follows is an overview of a presentation that… Read more

4 comments, 1,958 reads

Posted in SQL Quantum Leap on 30 December 2017

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

(If you’re reading this on SQL Server Central, please click here to see the “Featured Image” which will help explain the “Duck” vs “Rabbit” titles of this and the previous posts)

Welcome back! Previously, on “Who’s Collation is it Anyway?”, due to statements made in the Microsoft documentation for… Read more

3 comments, 1,763 reads

Posted in SQL Quantum Leap on 11 December 2017

Older posts