Transact SQL – Windowing Functions – Lag and Lead

Background Have used Windowing Functions for years now. But, never used Lag and Lead. Just thought it was too hard to layer on top of what was already hard for me.   Easy Finally today, I ended up dealing with something actually hard for me. A good man gracefully scaled it and he sprinkled in … Continue reading Transact SQL – Windowing Functions – Lag and Lead

SQLCMD:- Informational Message – “Changed database context to ….”

Background Let us quickly address a message pattern that is familiar to those who use sqlcmd. Message The message reads "Changed database context to ...." Source It is sourced to the presence of "use [database]" within a SQL command or file.   Remediation We have a bit of control over whether SQL Server emits the … Continue reading SQLCMD:- Informational Message – “Changed database context to ….”

Transact SQL – STRING_AGG – Error – “Multiple ordered aggregate functions in the same scope have mutually incompatible orderings.”

Background Working on some Transact SQL code yesterday. Ran into an error that was new to me. Error Error - Image Error - Text Sample Code The original code is a bit complex and sharing it will distract from this post's point. So here we go with sample code:-   Outline Original The original code … Continue reading Transact SQL – STRING_AGG – Error – “Multiple ordered aggregate functions in the same scope have mutually incompatible orderings.”

SQL Server Management Studio ( SSMS ) – Editor – Tabs and Spaces

Background When writing code, one gets to decide whether Tabs are kept as is; or have the editor automatically converts tabs to spaces.   SQL Server Management Studio ( SSMS ) Let us review SSMS Toolings as it relates to tabs and spaces.   Outline Editor Editing Choose Tabs or Spaces Selected Text Convert "Tabs … Continue reading SQL Server Management Studio ( SSMS ) – Editor – Tabs and Spaces

sqlcmd – Avail on MS Windows

Background Trying to a DOS Command batch on an MS Windows Box. Ran into an easy to correct error. Error Error Image Error Text   Remediation Outline Identify sqlcmd Download sqlcmd Install sqlcmd   Identify sqlcmd artifacts sqlcmd is available here. Images   Download sqlcmd Depending on the bitness of your OS, please choose (x64) … Continue reading sqlcmd – Avail on MS Windows

SQL Server – Transact SQL – Function – Unicode – Online Sample

Background Earlier this week I was helping a family member with an exercise. Transact SQL - Unicode His exercise involved using the Unicode function. Sample Googling landed me at the official Microsoft documentation for the Unicode Function. Documentation Unicode Transact SQL Link Microsoft Sample Microsoft Sample -01 Code Output     Microsoft Sample -02 Outline … Continue reading SQL Server – Transact SQL – Function – Unicode – Online Sample

SQL Server – Configuration – Default Directories

Background In the last few days knee-deep reviewing SQL Server Installs and Scripts. ServerProperty In the last hour or so found myself looking at what is exposed via ServerProperty. Folders Here are some of the File System folder entries exposed through the ServerProperty function. InstanceDefaultDataPath Name of the default path to the instance log files. … Continue reading SQL Server – Configuration – Default Directories

Transact SQL :- sys.dm_os_enumerate_filesystem – Error – 0x8007007a

Background Still stuck on sys.dm_os_enumerate_filesystem. Want to touch on a couple of diagnostic steps. Lineage Posts along same subject. Transact SQL :- sys.dm_os_enumerate_filesystem Date Published :- 2020-04-23 Link Usage Syntax SQL Sample Sample -01 SQL Output Issues Issue - "Internal error. The string routine in file sql\ntdbms\storeng\dfs\alloc\storagedmv.cpp, line 799 failed with HRESULT 0x8007007a." Error Message … Continue reading Transact SQL :- sys.dm_os_enumerate_filesystem – Error – 0x8007007a

Transact SQL :- sys.dm_os_enumerate_filesystem

Background Will like to take a few minutes to discuss an un-documented Transact SQL function. The function's name is sys.dm_os_enumerate_filesystem. Usage Syntax SQL Sample Sample -01 SQL Output Issues Issue - Parameter is incorrect Error Message Textual Image Explanation We passed a null or an empty string as the file pattern to look for. Remediate … Continue reading Transact SQL :- sys.dm_os_enumerate_filesystem

UDP Flood Attack

Background My Internet connection has been spotty for a while here. TroubleShooting Finally, took the time this evening to see what is going on. Outline Router Check the Router Wireless Access Point Check the Wireless Access Points Computer & Hosts Check the computers and hosts connected to your Router & Hosts Internet Service Provider Check … Continue reading UDP Flood Attack