TSQL Tips – Modifying text in rows

I have been doing some loading of random text in tables, but wanted to make changes to some of the text in rows, instead of running a full update operation, I discovered that you can also use TSQL functions REPLACE or STUFF to change text. Below are examples: UPDATE Dbo.Table_1 SET c2 = (SELECT REPLACE(c2,’It’,’This’))…


Verifying if a connection to SQL Server is Encrypted

If you do not have a network parser such as netmon and want to verify if the connection from the client to the SQL server is encrypted, the following query can be utilised: SELECT encrypt_option FROM sys.dm_exec_connections WHERE session_id = @@SPID — Note: remove the WHERE clause to see all connections.