Tuesday, March 20, 2012

MS SQL 2008 Standard does not support database compression


I thought is was a normal morning at the office . So, I check job history on all my sql instances and noticed that FULL backups were failing from the night before. Why you ask? Well , I added the compression as default to my sql server boxes backup plans the night before.
Microsoft doesnt even give you an error when adding compression to maintenance plans.
Moral of the story, dont trust that backups are working. Check them every day. You might say , just add a notification to task for failure. However, what if your SMTP is having issues also.
Check for errors in your jobs.

Thursday, March 8, 2012

Change the database name

alter database tmsng1
set single_user
go
USE master;
GO
ALTER DATABASE tmsng1
Modify Name = tmsng
GO
use master
go
alter database tmsng
set multi_user

Tuesday, March 6, 2012

Create a timestamp updatable column

SQL DBA's --have you ever create a column that holds modified time. Yes. Well it probably held the inserted time. It didnt work for the updated time. This little script will work for you very well.
create TRIGGER [dbo].[Account_UTrig] ON [dbo].[Account]
FOR INSERT, UPDATE
AS

UPDATE Account
SET Account.ts = getdate()
FROM Account INNER JOIN INSERTED ON Account.[AccountID] = INSERTED.[AccountID]