How to Backup a Database Table on the Fly Using this Simple SQL Command

Database Table Backups on the Fly

This is a super simple SQL super power trick I learned from a mentor.

If you’re working in SQL Server Management Studio (SSMS) you can open up a New Query window and type in a simple “SELECT INTO” command to backup a database table on the fly.

Sample SQL SELECT INTO Statement

SELECT * INTO new_table FROM old_table_20221122

This is pretty simple. You’re making copying of a table like a “Save As” button would let you do.

This is also great for undoing something bad you’ve done by simply reversing the process.

Author: Rick Cable / AKA Cyber Abyss

- 16 year US Navy Veteran. - 20 years in software development and many other IT roles. - Currently in role as senior full-stack software developer supporting multiple teams and products at a large healthcare organization. - Part-time Hacking, Lock Picking and OSINT enthusiast. - Founder of FinditClassifieds.com in 1997 to present. - Co-founder of LK2 Software 1999-2002.