Geeks With Blogs
mikedopp Geekswithblogs (edition) April 2008 Entries
All Your Base Belong to SQL or Backup all your SQL Databases with one Query
Most of you would rather the the first title before or. Can't Remember where I got most of this script(if you know please send me a hate email) however I did some enhancements and I am reposting it. DECLARE @DBName varchar(255) DECLARE @DATABASES_Fetch int DECLARE DATABASES_CURSOR CURSOR FOR select DATABASE_NAME = db_name(s_mf.database_id) from sys.master_files s_mf where -- ONLINE s_mf.state = 0 -- Only look at databases to which we have access and has_dbaccess(db_name(s_mf.d... = 1 -- ......

Posted On Thursday, April 24, 2008 7:25 AM

Copyright © mikedopp | Powered by: