Technical Article

Using DDL Database Triggers

In this short demonstration, you'll learn how to use DDL database triggers to prevent changes to product and audit changes to comply with Sarbanes-Oxley and other change management requirements. Free registration required.

External Article

Transform your SQL scripts with SQL Prettifier

This article describes the "beta" version of Simple-Talk's SQL formatting tool, SQL Prettifier. It provides links both to try it out online and to download the full source code (members only). Please give us your feedback! We will be offering prizes for any fixes and improvements that make it into "v1". I'd like this to become the de-facto (excuse the pun) tool for presenting code in the Simple-Talk articles, blogs and forums.

Blogs

Using SQL Compare with Redgate Data Modeler

By

Redgate recently released SQL Compare v16, which included a new feature to work with...

Who’s the Winningest Coach (with AI Help)

By

I was listening to the radio the other day and the hosts were discussing...

Learning from Mistakes: T-SQL Tuesday #194

By

We’re a week late, once again my fault. I was still coming out of...

Read the latest Blogs

Forums

Basic Always On Groups Randomly Stop Synchronizing

By Leo.Miller

In one of my environments I have 3 pairs of Always On SQL 2022...

Learning From Breakage

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Learning From Breakage

Python in Action to Auto-Generate an Optimized PostgreSQL Index Strategy

By sabyda

Comments posted to this topic are about the item Python in Action to Auto-Generate...

Visit the forum

Question of the Day

Adding and Dropping Columns I

I have this table in my SQL Server 2022 database:

CREATE TABLE [dbo].[CityList]
(
[CityNameID] [int] NOT NULL IDENTITY(1, 1),
[CityName] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
I decide to add two new columns for the StateProvince and Country. What code should I use?

See possible answers