TSQL Code Categories MS SQL Server BI MS SQL Server Performance MS SQL Server Agent Jobs MS SQL Server Backup/Restore Examples MS SQL Server Blocking Change Default Database Fix SQL Login Update Table From Other Table Rename an SQL Server MS SQL Server Files & FileGroups MS SQL Server Functions MS SQL Server Information MS

Read more…

Use this script to create an SSRS report that will display all database(s) restored on one server. Alternatively, you may create a database and run an SSIS package that loads every day’s results into a location where you can run reports against that data. This is often called a “Meta data repository”. Read the rest

Read more…

Source Article: http://www.dbafarm.com/ PowerShell Copy Backup to network share Seems simple, but it’s not. I tried the following scenarios: 1. Local copy 2. Copy to share 3. Copy to share on different domain 4. Copy to admin share *Note : this script can also Mirror the source and destination– just like the /Mir robocopy switch,

Read more…

To initialize a secondary database in a log shipping configuration use the code below. This will leave the database in a read_only state waiting for future logs from the primary database. Modify the areas in bold to fit your needs. USE MASTER GO RESTORE DATABASE [db_name] FROM DISK = N’D:LogShipping_tempdb_name_xxxxx.bak’ WITH FILE = 1, STANDBY

Read more…