Tags » T-SQL

Exploring system tables, views, SPs etc

I wanted to spend a few minutes highlighting a couple of important tools for figuring out what information you have available to you within SQL Server. 459 more words

SQLServerPedia Syndication

Using EXECUTE AS to control data access

Introduction

Ownership chaining is one process that SQL Server uses to allow stored procedures access to tables where the user might not have permission. It has issues with stored procedures that have dynamic sql – EXECUTE AS is one solution. 1,655 more words

SQL

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-18)

This is Part 3 of 2. Yes, you read that correctly. You see, way back at the very beginning (i.e. in Part 1… 2,691 more words

Programming

Automate Import of Active Directory Records into SQL Server

Previously we detailed how to query Active Directory with the help of a linked server in SQL Server. Now let’s take it a step further by automating the process of retrieving the records from Active Directory and storing them in a SQL Server database using a job schedule. 614 more words

Sql Server

Deleting a lot of data

I recently had the task of deleting a bit over a billion rows from a table. Now I could have done just this:

DELETE FROM tablename WHERE createdate >= '1/1/2017' 490 more words
SQLServerPedia Syndication

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

(last updated: 2018-04-10)

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… 1,503 more words

Programming

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

(last updated: 2018-04-18)

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. 3,104 more words

Programming