Archives: December 2010
Hi people, following a script that deletes all tables in a database. Enjoy.
SET NOCOUNT ON;
DECLARE @Tabela TABLE
( Seq INT,
DECLARE @Loop INT, @Qt INT;
-- While there ForeignKey exclude objects that are not referenced recursively
WHILE (SELECT COUNT(*) FROM… Read more
The Profiler is a powerful tool available to the dba, but it can also be very useful for system developers. Of course I'm thinking about development environments (production never). Thus, the profiler can help developers monitor the queries and stored procedures developed in the applications.
Follow the instruction to… Read more
Occasionally I need to see what the date of last restart of SQL Server. The old method isto check the creation date of tempdb database. However, in SQL 2008 we have a DMV that can be used for this purpose: sys.dm_os_sys_info. Here's how:
1) Searching creation of tempdb
SELECT… Read more
Sometimes when we need to do some maintenance on a SQL server, you need to verify which users are connected or which databases are being used. A quick and easy wayto check the server utilization is simply to identify which databases are being accessedat that time. Thus, I present two… Read more