About
Digital Colony is the technical web site for Michael Allen Smith of Seattle.
Category Archives: SQL
Test Using EXISTS Before Inserting
Here is a sample stored procedure that prevents duplicate inserts with the same value by first performing a test using SQL Server’s EXISTS statement. IF OBJECT_ID(‘prcTagNameInsert’) IS NOT NULL DROP PROCEDURE prcTagNameInsert GO CREATE PROCEDURE prcTagNameInsert @tagName VARCHAR(50) AS IF … Continue reading
SQL Injection – Case Study
Well I got nailed today. My site INeedCoffee.com which is written using Classic ASP fell victim to a SQL Injection attack. The damage was limited to just one column in a table of nine rows. Textbook SQL Injection Attack Almost … Continue reading
Outer Joins Against A Date Range
This article is written for SQL Server, which supports user-defined functions and OUTER JOINS. All examples come from the Northwind database which is part of the default installation of SQL Server. In SQL an OUTER JOIN is where you want … Continue reading
