Backup Database Tables with 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

A 16 year US Navy Veteran with 25+ years experience in various IT Roles in the US Navy, Startups and Healthcare. Founder of FinditClassifieds.com in 1997 to present and co-founder of Sports Card Collector Software startup, LK2 Software 1999-2002. For last 7 years working as a full-stack developer supporting multiple agile teams and products in a large healthcare organization. Part-time Cyber Researcher, Aspiring Hacker, Lock Picker and OSINT enthusiast.