SQL Server Agent step using a Linked Server

Have you ever needed to create a SQL Server Agent job that hits a linked server? Getting this to work properly had caused me to pull out some of whatever hair I had left. I kept getting the following error:

Executed as user: NT SERVICE\SQLSERVERAGENT. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. [SQLSTATE 28000] (Error 18456).  The step failed.

Luckily, I stumbled onto a solution. 

Essentially, you need to map the NT Service\SQLSERVERAGENT user to the remote user on your linked server entry. Setting Job or Step to run as a user impersonating a valid remote user will not get the job done.

In order for this to work correctly you need to go to your linked server properties screen:

Linked server impersonation

Add an entry for “NT Service\SQLSERVERAGENT”, and enter the appropriate Remote User and Remote Password.

Run your SQL Agent job, and everything should work as expected!

Datatables.net Server Side processing

Overview

This post is directed towards .Net developers interested in setting up a server-side processed DataTable.  I’m assuming that if you’re reading this post, you’re already familiar with DataTables, a very powerful jQuery plugin that allows a developer to create responsive, full-featured data grids with pagination, filtering, etc.

The problem with most implementations of DataTables written by .NET developers is that they’re typically written using some sort of repeater.  In Web Forms, you can use an ASP.Net Repeater.  In MVC with Razor, you can use a @foreach loop to display multiple rows.

These implementations work best with limited data sets.  Larger sets of data leads to slow-loading pages, and consequently, end-user dissatisfaction.  If this is the problem that you’ve run into, read on for a solution.

Continue reading “Datatables.net Server Side processing”