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

Differences Between the Various Binary Collations (Cultures, Versions, and BIN vs BIN2)


(last updated: 2019-03-15 @ 02:45 EST / 2019-03-15 @ 06:45 UTC )

Binary collations are, in many ways, simpler to understand than non-binary collations because they don’t have any complex, culture-based linguistic rules. They just work with the character values and there is little room for mystery: all characters have… Read more

3 comments, 186 reads

Posted in SQL Quantum Leap on 13 March 2019

Cruel Joke: Prevent SQL Server From Starting, and With (Almost) No Indication Why

(last updated: 2019-03-07 @ 15:40 EST / 2019-03-07 @ 20:40 UTC )

I ran across something the other day that I thought would be more interesting / useful, but it ended being merely disturbing.

For some reason (most likely an obsolete one), SQL Server looks for the following file:

%SQLBinRoot%\sqlservr.ini…

Read more

2 comments, 2,542 reads

Posted in SQL Quantum Leap on 1 March 2019

What Does the Undocumented UNCOMPRESS Function Do?

(last updated: 2019-02-26 @ 23:00 EST / 2019-02-27 @ 04:00 UTC )

IntelliSense in SQL Server Management Studio (SSMS) can be quite helpful. It can save time typing by presenting possible object or function names. And, it can even show you the signatures (i.e. input and output parameters / return… Read more

1 comments, 490 reads

Posted in SQL Quantum Leap on 26 February 2019

How Does DBCC CHECKIDENT Really Work When Resetting the Identity Seed (RESEED)?

(last updated: 2019-01-31 @ 22:45 EST / 2019-02-01 @ 03:45 UTC )

Today’s “Question of the Day” on SQL Server Central, Cleaning up the Identity, is about using DBCC CHECKIDENT to reset the seed value of an IDENTITY column to a specific starting value. The question asked what the… Read more

4 comments, 2,713 reads

Posted in SQL Quantum Leap on 31 January 2019

Beware! Beware of Unintended Changes When Altering Columns!


(last updated: 2019-01-15 @ 19:50 EST / 2019-01-16 @ 00:50 UTC )

I haven’t seen a lot written about these particular behaviors so I thought I would mention them. And, while they are documented, that doesn’t mean that most people are aware of them.

What I am referring to are… Read more

0 comments, 2,200 reads

Posted in SQL Quantum Leap on 15 January 2019

Prevent Full Script Execution (Understanding and Using PARSEONLY and NOEXEC)

(last updated: 2019-01-08 @ 13:53 EST / 2019-01-08 @ 18:53 UTC )

There are times when I am working on a SQL script that really shouldn’t be executed all at once. Sometimes it’s a series of examples / demos for a presentation or forum answer. Other times it’s just a… Read more

1 comments, 3,198 reads

Posted in SQL Quantum Leap on 28 December 2018

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, 3,051 reads

Posted in SQL Quantum Leap on 31 October 2018

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


(last updated: 2019-01-10 @ 16:00 EST / 2019-01-10 @ 21:00 UTC )

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

For some time now, many of us have struggled with data that is mostly standard US-English / ASCII characters but also needs to… Read more

5 comments, 1,545 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)?

(last updated: 2019-01-10 @ 18:00 EST / 2019-01-10 @ 23:00 UTC )

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… Read more

5 comments, 2,617 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: 2019-01-07 @ 02:25 EST / 2019-01-07 @ 07:45 UTC )

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… Read more

5 comments, 3,598 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

5 comments, 1,091 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, 222 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: 2019-01-05 @ 23:15 EST / 2019-01-06 @ 04:15 UTC )

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… Read more

4 comments, 1,035 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,830 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,877 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

3 comments, 474 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,285 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,184 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

5 comments, 2,568 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,312 reads

Posted in SQL Quantum Leap on 12 February 2018

Older posts