SQL 2005 DBA

Msg 0, Level 11, State 0, Line 0 error adding data file

0
Your rating: None

I got this error when trying to add a file to a full database:

Msg 0, Level 11, State 0, Line 0. A severe error occurred on the current command.

But, nothing was logged anywhere that gave me a hint as to what the problem was. I knew from past experience that sometimes if the first data file in a database is completely full, you will get an error like this. But, I had 33MB available. So, I gave it 50MB more and was able to add files to the database again. Hope this helps someone.

SQL Saturday #68 Transactional Replication Inside and Out

0
Your rating: None

This past weekend, I gave a talk at the Olympia, WA SQL Saturday conference on Transaction Replication. I am posting up my slide deck and script files for monitoring replication performance and last hours replication errors. Both of these procs need to be run on your distributor server and the prc_internalsendmail can be replaced with your mail proc of choice, including sp_send_dbmail.

http://sqlsaturday.com/viewsession.aspx?sat=68&sessionid=3979

Automated Restore Database from Last Full Backup

5
Your rating: None Average: 5 (1 vote)

In my environment, I backup to many files (for faster backups), and need to restore to a custom location. This query gets latest full backup info and restores to the path you specify. Tested on SQL 2005/2008.

 

Patterns and Practices for SQL Server

0
Your rating: None

Microsoft has some great information on best practices for development and server configuration. Here are some great links.

 

Patterns and Practices Developer Center: http://msdn.microsoft.com/en-us/practices/default.aspx

DBCC INDEXDEFRAG vs ALTER INDEX REORGANIZE

0
Your rating: None

I recently had a discussion about this with some co-workers who wanted to use the old dbcc command on SQL 2005 server. After a bit of research in BOL and web I found that indeed we should be using the new Alter Index reorganize version as it compacts LOB data also by default, other than that it uses the same algorithm.

 

BOL snippet:

SQLSaturday #43 Talk on Replication Performance Tuning and Troubleshooting

5
Your rating: None Average: 5 (1 vote)

This past Saturday, I gave a talk on SQL Server Replication Performance Tuning and Troubleshooting. The talk went great and everyone seemed to have learned alot. The attendance was great even though Buck Woody was talking next door. Tough competition!

 

I have attached my powerpoint deck of my talk to this post. Other good links for my custom replication scripts are:

http://www.sqlwebpedia.com/content/sql-replication-undelivered-command-count

SQL Replication Undelivered Command Count

0
Your rating: None

Ever wanted to get an email summary of subscriptions that are behind a certain amount? This script can do it! Just setup as a job on your distributor and it will send you a summary email with how many commands are yet to be delivered in a table format for easy reading.

 

SQL Replication Error Summary

0
Your rating: None

We had a script that would try to get all the information about replication's current condition, but I felt it was doing too much and didn't do a good enough job. So, I re-wrote it in to two scripts. This script will tell you all the errors that have happened in past hour. Schedule it as a job on your distributor box and it will email you only when there were errors.

The Ultimate MS SQL Backup Script

4.375
Your rating: None Average: 4.4 (8 votes)

I am finally getting around to publishing my ultimate Microsoft SQL Server Backup scripts. All told, it is about 1600 lines of code and it can do just about anything you would need for Native or Quest Litespeed backups.

http://www.sqlwebpedia.com/files/Scripts/DBOPSBackupScripts.zip

Here are some examples so you get idea of its power.

PowerShell Script to Export SQL Schema Definition

4.166665
Your rating: None Average: 4.2 (6 votes)

Ganesh Kaliaperumal created a script to export schema to files for us to easily compare with WinMerge. Check out the options and modify as needed.
Call from powershell command line like so:
.\GenerateScript.ps1 "Servername" "Adventureworks" "c:\scripts\powershell\"