Category Archives: SQL Server

T-SQL: Trim after newline / carriage return

SELECT product_id,name,revision ,description = REPLACE( CASE WHEN CHARINDEX(CHAR(10),description,1) > 0 AND description LIKE ‘%’ + CHAR(10) + ‘%’ AND PATINDEX(‘%Alternate%’,description) > 0 THEN LEFT(description, CHARINDEX(CHAR(10),description,1)-1) ELSE description END , CHAR(13), ”) FROM qs_products Note: This query is somewhat case-specific. My … Continue reading

Posted in SQL Server | Leave a comment

Meltdown and Spectre patches, via SQLServerCentral

http://www.sqlservercentral.com/articles/SQL+Server/166822/?utm_source=SSC&utm_medium=pubemail  

Posted in Linkdump, SQL Server, System/DB Administration | Leave a comment

SQL Server diagnostics notes

This week’s amusement: performance of a recently-implemented Stored Procedure dropped and dropped to intolerable levels. This system cannot be easily upgraded. Significant fragmentation is involved. Memory pressure is involved. Inserts to table variables in multiple stored procs are involved. This … Continue reading

Posted in Linkdump, Programming, SQL Server, System/DB Administration | Leave a comment

Clone programming steps

— list products that might need to be programmed. SELECT name,revision, product_id FROM qs_products where name like ‘277000-200-%’ — list current programming steps select p.name,p.revision,steps.* from [dbo].[ACA_swprg_programming_steps] steps INNER JOIN qs_products p ON p.product_id = steps.mes_product_id — after updating the … Continue reading

Posted in SQL Server | Leave a comment

Populate NULL component_ids from related tables

Needed to populate a new column in one table from a semi-related existing table, based on a value in another related table. I do this once in a blue moon and needed a refresher. Thanks, Pinal Dave, for your post … Continue reading

Posted in SQL Server | Leave a comment

Linkdump: SQL Server T-SQL tips and tricks

SQL Server Row Count for all Tables in a Database https://www.mssqltips.com/sqlservertip/2537/sql-server-row-count-for-all-tables-in-a-database/ One of several techniques posted by Dattatrey Sindo: SELECT QUOTENAME(SCHEMA_NAME(sOBJ.schema_id)) + ‘.’ + QUOTENAME(sOBJ.name) AS [TableName] , SUM(sPTN.Rows) AS [RowCount] FROM sys.objects AS sOBJ INNER JOIN sys.partitions AS sPTN … Continue reading

Posted in Linkdump, SQL Server | Leave a comment

Linkdump: Docker, Puppet, SQL Server hosting

http://www.sqlservercentral.com/blogs/the-database-avenger/2017/06/13/orchestrating-sql-server-with-kubernetes/?utm_source=SSC&utm_medium=pubemail http://www.sqlservercentral.com/blogs/the-dba-who-came-in-from-the-cold/2017/06/14/changing-default-location-for-docker-containers/?utm_source=SSC&utm_medium=pubemail https://www.red-gate.com/simple-talk/sysadmin/containerization/overcoming-challenges-microservices-docker-containerisation/?utm_source=DBW&utm_medium=pubemail Lab Guide Working with Containers on Windows 10–Includes Docker and Nano Step-By-Step https://github.com/docker/labs/blob/master/windows/windows-containers/Setup-Server2016.md  

Posted in Linkdump, SQL Server, System/DB Administration | Leave a comment

Onboarding tasks: SQL Server

https://www.mssqltips.com/sqlservertip/4871/sql-server-dba-onboarding-checklist/  

Posted in Business, Linkdump, SQL Server | Leave a comment

How to Read the Transaction Log File

Whoa, nice. How to Read the Transaction Log File Have you ever wanted to be able to see the actual transactions that are contained in the transaction log file? ¬†Well there is a way to read the transaction log file … Continue reading

Posted in Linkdump, SQL Server | Leave a comment

Kendra Little’s free SQL Server training webcasts

New Free Webcasts on Interviewing and Indexing https://littlekendra.com/2017/06/29/new-free-webcasts-on-interviewing-and-indexing/

Posted in Linkdump, SQL Server, System/DB Administration | Leave a comment