Skip to content

Instantly share code, notes, and snippets.

'''
File: mouse_move3.py
Project: auto-move mouse
Created Date: 2024-03-27
Author: Adge Denkers
Email: adge.denkers@gmail.com
-----
Last Modified: 2024-04-03
Modified By: Adge Denkers
Email: adge.denkers@gmail.com
'''
File: mouse_automove2.py
Project: mouse_automove
Created Date: 2024-03-27
Author: Adge Denkers
Email: adge.denkers@gmail.com
-----
Last Modified: 2024-04-02
Modified By: Adge Denkers
Email: adge.denkers@gmail.com

In SQL Server, the term "nesting level" refers to the depth of nested actions triggered by triggers. When a trigger on a table causes another trigger to be fired, this creates a nesting of triggers. The function TRIGGER_NESTLEVEL() is used to determine the level of nesting for the trigger currently being executed.

Here's a bit more detail on TRIGGER_NESTLEVEL():

Purpose: TRIGGER_NESTLEVEL() is a function in SQL Server that returns the number of triggers executed in a chain of nested triggers. This helps in managing and controlling recursive or nested triggers execution.

Usage: You can use TRIGGER_NESTLEVEL() to:

Prevent excessive nesting which could lead to stack overflow, performance degradation, or logical errors in the application. Control or limit the recursive behavior of triggers by setting a maximum allowed nesting level.

@adgedenkers
adgedenkers / new_sql_table.sql
Created March 5, 2024 16:13
New SQL Tables
CREATE TABLE table_name (
id INT PRIMARY KEY IDENTITY(1,1)
,title VARCHAR(15)
,created DATETIME NOT NULL DEFAULT GETDATE()
,updated DATETIME NULL
,is_active INT NOT NULL DEFAULT 1
);
GO
CREATE TRIGGER trg_UpdatedTableName
@adgedenkers
adgedenkers / build_dim_date.py
Last active February 3, 2024 15:58
Release v1 of Date Dimension Population Script
'''
File: build_dim_date.py
Project: fz
Created: 2024-02-03
Author: Adge Denkers
https://github.com/adgedenkers/
License: MIT License
'''
import psycopg2
@adgedenkers
adgedenkers / pokemon.py
Last active February 2, 2024 22:56
Fully Functional Web Scraper for Pokemon Information
'''
File: pokemon.py
Project: resources
Created: 2024-02-02
Updated: 2024-02-02
Author: Adge Denkers
https://github.com/adgedenkers/
Versoin: 0.1.0
License: MIT License
'''
-- Dropping existing views
DROP VIEW IF EXISTS view_people_addresses;
DROP VIEW IF EXISTS view_people_phone_numbers;
DROP VIEW IF EXISTS view_people_emails;
-- Dropping existing tables
DROP TABLE IF EXISTS people_email_mapping CASCADE;
DROP TABLE IF EXISTS people_phone_number_mapping CASCADE;
DROP TABLE IF EXISTS people_address_mapping CASCADE;
DROP TABLE IF EXISTS people_household_mapping CASCADE;
CREATE PROCEDURE GetTeamNameOrAbbreviation
@team NVARCHAR(255),
@slot INT
AS
BEGIN
IF @slot = 0
BEGIN
-- Extract and return the part before the parentheses
RETURN LEFT(@team, CHARINDEX(' (', @team) - 1)
END
'''
File: (script-name)
Version: (script version number)
Description: (description of script)
Project: (project name)
Created Date: (date file created [yyyy-mm-dd format])
Author: Adge Denkers
Email: adriaan.denkers@va.gov
-----
Last Modified: (date file updated [yyyy-mm-dd format])
'''
Name: (script-name)
Description: (description of script)
Author: Adge Denkers / https://github.com/adgedenkers/
Created: (creation date)
Updated: (last update date)
(C) (current year) denkers.co
'''