Another Happy Customer
After finishing a recent project we received this feedback from the customer. As a community health center with many competing priorities and limited resources, we… Read More »Another Happy Customer
After finishing a recent project we received this feedback from the customer. As a community health center with many competing priorities and limited resources, we… Read More »Another Happy Customer
Occasionally I have come across the need to save the output from a query to a varchar value, for instance varchar(max). There are lots of ways to do this, could you use a cursor and just append to a string each loop through the cursor, but there is an easier way.
Examples of a need to do this would be to write the output to a file, or to build an email message that is going to be sent, or many other possible scenarios.
Lets start with a simple query on SQL Server 2019, grabbing a list of databases, and with a where clause to keep the list short for now.
--start with a simple query
SELECT *
FROM sys.databases
WHERE database_id < 9;
Which produces output something like this.
Now lets trim it down to just the data we want to build into string output.
Read More »Saving Query Output to a StringSQL Server Alert System: ‘Severity 20 – Fatal Error In Current Process’DESCRIPTION: SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection… Read More »Severity 20 – Fatal Error
Part of good server monitoring it to have alerts enabled for a number of different errors to know when things go bad. The problem is… Read More »SQL Server Alert System: ‘ERROR 824’
Recently while working on a SQL Server for a client I came across the following error when I attempted to view the SQL Server logs… Read More »sp_readerrorlog – Msg 22004, Level 16, State 1, Line 0 – Failed to open loopback connection. Please see event log for more information.
Serializable, and some of the other isolation levels can have performance implications. Recently I came across a case where I needed to find queries that… Read More »Finding Serializable Queries
Should I upgrade from SQL Server 2008 and SQL Server 2008 R2 now that it is at end of life? On July 9, 2019 SQL… Read More »Upgrading SQL Server 2008 and R2
Here is a quick script that I find myself using frequently to find the largest tables on an entire SQL Server instance.
It is interesting, when working with many different clients, the questions about installing Windows Updates and SQL Server updates comes up and often the discussion… Read More »Latest Service Packs – To Install or Not to Install?