Determing SQL Server Table Size within a Database

A common problem that I have recently encountered was trying to identity which table within a database was the biggest one (in record size), therefore, taking up the most physical storage space. I found and modify this store procedure to work with MSSQL 2000, MSSQL 2005, and MSSQL 2008  that will perform all needed data calls and will return a result set with the data on all tables. T-SQL Code:   USE DWDATA GO CREATE PROCEDURE GetAllTableSizes AS /* Obtains spaced used data for ALL user tables in the database */…

Read More

Oracle: Using the AFTER INSERT and AFTER UPDATE triggers

A database trigger is a stored procedure that automatically executes whenever an event occurs. The event may be insert-delete-update operations. Oracle initiates an ‘AFTER INSERT’ trigger after an insert event has occurred and an ‘AFTER UPDATE’ trigger after an update event has occurred. Let’s see an example for ‘AFTER INSERT’ trigger. Syntax: CREATE or REPLACE TRIGGER trigger_name AFTER INSERT ON table_name FOR EACH ROW DECLARE variable declarations BEGIN trigger statement END; First problem: We want to insert a record…

Read More

Posted in Oracle Tagged , Comments Off on Oracle: Using the AFTER INSERT and AFTER UPDATE triggers