Tuesday, December 13, 2011

Move a database path during a restore!!

SQL Dba's are you moving databases between PROD and DEV. They have different file structures right? Well try using the MOVE command with your restore. It will save time and effort.
restore database BuildingDepartment from disk =
'G:\backup\BuildingDepartment_backup_201112080500.bak'
with recovery,
MOVE 'BuildingDepartment' TO 'G:\Data\BuildingDepartment.mdf',
MOVE 'BuildingDepartment_Log' TO 'G:\Logs\BuildingDepartment.ldf'
go

Monday, December 12, 2011

Database diagram support objects can not be installed?

First make sure that there is a valid owner for the database. I.E. make sure owner is not blank.
If that doesnt fix your problem then try this command on the new query line.
ALTER AUTHORIZATION ON DATABASE::database_name TO valid_login