Bealer Blog

A blog to help me remember what in the hell i've done and what not to do again. ever. Maybe you'll learn from my mistakes or epiphanies. Blog topics include SQL, T-SQL, Google, Windows, Visual Basic, Python, C#, etc.

Tuesday, October 31, 2023

Swap a SQL script with commas on the left to the right side

›
Commas to the left or to the right? It's a SQL debate for the ages and both sides have terrific arguments. In case you find yourself ...
Friday, July 30, 2021

Windows short/abbreviated path to long using Python pathlib.resolve()

›
Some Python packages generate a Windows shortened path. For instance, a call to tempfile.TemporaryDirectory generates a url like "C:\Us...
Friday, October 4, 2019

Generate a simple 4-5-4 retail calendar (not restated) using T-SQL

›
Generate a NRF 4-5-4 retail calendar as described here . https://gist.github.com/sbealer/327ec8ab7c2814d9064bb52a1f5ea3bb
Monday, June 3, 2019

Select from stored procedure that uses temp tables

›
Don't do this. But if you HAVE to do this... USE YOUR_DATABASE GO CREATE OR ALTER PROCEDURE DBO.EXAMPLE_SELECT_FROM_PROCEDURE_WITH_T...
Wednesday, January 23, 2019

Microsoft Teams HMAC verification using Python 3

›
The example provided by Microsoft is in C#. Here is the equivalent in Python 3: from hashlib import sha256 import hmac import base64 ...
2 comments:
Monday, January 14, 2019

SQL Column DRY - Here's how to reuse a heavily modified field without repeating the modification multiple times.

›
--Using the values clause you can later reference a column that has been modified in the query. SELECT (SELECT SUBSTRING(DIGITS2, 1, 3) ...
Wednesday, January 2, 2019

ceODBC & Python 3

›
Download the ceODBC .whl file from here  & copy it to C: Open an administrator command prompt and run the following command: pip3 i...
Tuesday, March 13, 2018

Write to a gzipped csv from io.TextIO

›
I needed to get a compressed (gzip) csv to an Amazon S3 bucket. The below Python 3 code utilizes csv.writer and gzip in one step. Once t...
Tuesday, February 7, 2017

SQL Server recursive table valued function to find all required objects for an object

›
Do you have views built on views built on views? Would you like to analyze the dependency chain of some objects? The below function is a rec...
Monday, February 1, 2016

Unable to find vcvarsall.bat

›
Install Microsoft Visual C++ Compiler for Python 2.7: https://www.microsoft.com/en-us/download/details.aspx?id=44266
›
Home
View web version
Powered by Blogger.