Thursday, November 1, 2012

Find the last time all databases were used

select stat.database_id as database_id ,db.name as database_name ,max(stat.last_user_scan) as last_user_scan from sys.dm_db_index_usage_stats as stat join sys.databases as db on db.database_id = stat.database_id group by stat.database_id,db.name order by db.name asc

Can I upgrade my SQL Server 2008 R2 Trial to a full version?

If you are a GUI person just launch the SQL Server setup and go to the “Maintenance Tab”, you will see the “Edition Upgrade” option there. Follow a couple of steps in the wizard, provide the key and you are all set.

Tuesday, October 23, 2012

Developers have no access to linked servers after creating one

 So, you just created a linked server back to DB2 on MS SQL Server 2008R2. However, the developer calls you and says I getting this error;
 The EXECUTE permission was denied on the object ‘xp_prop_oledb_provider’, database ‘mssqlsystemresource’, schema ‘sys’. (.Net SqlClient Data Provider)

This script assumes the user is basis_admin
use master
go
create user basis_admin for login basis_admin
go
grant exec on sys.xp_prop_OLEDB_provider to basis_admin

Tuesday, September 25, 2012

How to create an SSIS package to import data

Open BIDS click new project >click Control Flow> Data flow > add source object and then add destination object. Next you can run the project or save it.


Wednesday, June 13, 2012

Msdb cannot be restored

Ever get stuck restoring a master database from a higher version of SQL server than the current one you just built? Well the post will help you.

Problem:
"Restore failed -The backup of the system database on device
msdb cannot be restored because it
was created by a different version of the server (134218407) than this server
(134218262)."

Solution :
bring the system(sql server) up to date with the hotfixes and service packs...