• Skip to main content
  • Skip to primary sidebar

DallasDBAs.com

Explaining SQL Server in plain english

  • Services
    • SQL Server Health Check
  • Pocket DBA®
  • Blog
    • Speaking
  • Testimonials
  • Contact
  • About

Code That Writes Code

April 28, 2023 by Kevin3NF Leave a Comment

“Work Smarter, not Harder”

We’ve all heard it before, pretty much any job, anywhere.

In our DBA slice of the IT world, this is very relevant to how we manage SQL Servers and the databases on them.

From scripts to check for Bad Things™, to writing efficient code.

In this video, I show a simple way to get SQL Server generate scripts you can run.  In this case I needed to run the same command against a large number of databases. Running it manually, or worse, doing it in the GUI is just not an option.  Enjoy!

The code that I will now use as a starter script:

-- Don't run this if you don't understand it 100%

Select 'ALTER Database ['+[name]+'] set Page_Verify Checksum, recovery Full, auto_shrink off;
go'
From master..sysdatabases
Where DBID > 4

Thanks for reading!

Kevin3NF

Follow @Dallas_DBAs

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to email a link to a friend (Opens in new window)
  • Click to print (Opens in new window)

Related

Filed Under: SQL, TSQL, video Tagged With: SQL, syndicated

About Kevin3NF

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Search

Sign up for blogs, DBA availability and more!


Categories

  • Accidental DBA
  • Apprentice
  • Azure
  • backup
  • backup
  • Beginner
  • Career
  • Configuration
  • Cycling
  • Dallas DBAs
  • Deployment
  • Emergency
  • Encryption
  • EntryLevel
  • Fries
  • Goals
  • HADR
  • HealthCheck
  • Index
  • Install
  • IRL
  • Management
  • Migration
  • MySQL
  • Oracle
  • PASS
  • Performance
  • Personal
  • Pluralsight
  • Podcast
  • PowerShell
  • red gate
  • Restore
  • Security
  • Speaking
  • SQL
  • sql 2005 log shipping suspect
  • sql injection
  • SQLSaturday
  • SSIS
  • SSMS
  • Summit
  • TIL
  • Tools
  • Training
  • Troubleshooting
  • TSQL
  • TSQL2sday
  • Uncategorized
  • Upgrade
  • vendor code modify
  • video
  • vNext

Copyright © 2023 · Genesis Sample on Genesis Framework · WordPress · Log in

Privacy Policy
 

Loading Comments...