SQL and Bible Studies:- Books in each Genre

Background The Bible is a collection of books. One can categorize the books in so many different ways. In this post, we will use someone else work. He has categorized bible books into genres.   SQL The work avails a couple of database platforms. In this post, we will provide working samples for Transact SQL … Continue reading SQL and Bible Studies:- Books in each Genre

Transact SQL – Select And “FOR XML PATH”

Background A very, very good friend of mine runs a website where he posts quite a bit. Others post on the same site. Thankfully one of the persons that posted linked to his corporate website, as well. A good thing as I found a few interesting posts on the guest author's website. Transact SQL Transact … Continue reading Transact SQL – Select And “FOR XML PATH”

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

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 – 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

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

Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”

Background Working on a script, but noticed an error when I tried to sort the data using the String_Agg within group clause. Code Let us reproduce using a sample data set. SQL Sample -01 SQL Output Sample -02 Outline If one reviews our output, one will notice that the cities are listed based on the … Continue reading Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”

SQL Server, SSMS, and Unicode characters

Background Here I am fraught with insomnia. Tried to review statistics on a table, but getting an error. Error Cannot find a table or object with the name Text Msg 2501, Level 16, State 45, Line 3 Cannot find a table or object with the name "[dbo].[M?_TEST]". Check the system catalog. Trouble Shooting Review Tables … Continue reading SQL Server, SSMS, and Unicode characters

DBeaver – Generate SQL Insert Statements from Data

Script SQL Insert Statement from Data Using SQL Server Management Studio ( SSMS), I entered quite a bit of data into a new table. Not wanting to ever repeat that arduous process, I sought out tools that will allow me to script out the data.   Script Data Yes, BCP will work, but I will … Continue reading DBeaver – Generate SQL Insert Statements from Data