External Article

Automatically Running a Process When SQL Server or SQL Agent Starts

Have you ever had a need to run a query or a process as soon as SQL Server starts? Or run some set of tasks when SQL Server Agent Starts? Possibly you want to run a cleanup routine, a copy process or have some task started each time SQL server or SQL Agent is started. Well if this is the case then this article will discuss a couple of options you might consider using to accomplish automatically running your process.

External Article

Database Geek of the Week - Itzik Ben-Gan

Itzik Ben-Gan is a writer and mentor in the development community. He writes a monthly column for SQL Server Magazine and co-authored Advanced Transact-SQL for SQL Server 2000 . He is one of the founders of Solid Quality Learning, a global provider of education and solutions for the Microsoft database platform, and serves as its principal mentor.

External Article

Auto Logout Users for DB Maintenance

One thing Access developers love about using SQL Server as the back end is that it is easy to do maintenance. I can't tell you how many times I toured around an office, looking for users who had their client open and connected to the data so I could ask them to log out. Too many times, the offender was at lunch or away from their desks, with their desktops locked.

Technical Article

Hacker's-eye view of SQL Server

If a hacker sets sights on your SQL Server, there are four primary methods he can use to take control and carry out unauthorized, malicious activity. I will look at each of these: Password compromise, Account compromise, SQL injection, Buffer overflows

Blogs

Learning from Mistakes: T-SQL Tuesday #194

By

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

Stupid Things I Did With AI: ASCII Art

By

I ran across this article recently (https://www.gatesnotes.com/meet-bill/source-code/reader/microsoft-original-source-code) and it has a great opening piece...

Simple Talks Podcasting in 2026

By

I’m in the UK today, having arrived this morning in London. Hopefully, by this...

Read the latest Blogs

Forums

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

Adding and Dropping Columns I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Adding and Dropping Columns I

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