Monthly Archives: January 2018

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

save to DB & update DT+DGV, vs Total UI requery from DB

Here’s code for this… save to database + update local datatable + update local datagridview = faster than refreshing UI from database if (lblSerialNumberId.Text != “”) { MesQueries.SRUSheetCreation sru = new MesQueries.SRUSheetCreation(_mq); string serial_number_id = lblSerialNumberId.Text; string change_orders = txtChangeOrders.Text; … Continue reading

Posted in C#, Programming | 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