Skip to content

Instantly share code, notes, and snippets.

@jeverington
jeverington / 0_reuse_code.js
Created July 29, 2014 11:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jeverington
jeverington / Reset Oracle SYSTEM password
Created September 17, 2012 10:13
Oracle: Reset forgotten/unknown SYSTEM password
For Oracle SQL Express
Commandline : sqlplus / as sysdba
Then run "alter user system identified by NewPasswordHere;"
@jeverington
jeverington / Find Row Count in Table
Created August 16, 2012 09:29
Find Row Count in Table
SELECT sc.name +'.'+ ta.name TableName
,SUM(pa.rows) RowCnt
FROM sys.tables ta
INNER JOIN sys.partitions pa
ON pa.OBJECT_ID = ta.OBJECT_ID
INNER JOIN sys.schemas sc
ON ta.schema_id = sc.schema_id
WHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0)
GROUP BY sc.name,ta.name
ORDER BY sc.name,ta.name DESC
@jeverington
jeverington / SQL Table Order for import
Created August 16, 2012 09:29
Determine the load order of tables so that you don’t have to drop foreign key constraints to load related data (http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72957)
-- Start of Script - Find_Table_Reference_Levels.sql
/*
Find Table Reference Levels
This script finds table references and ranks them by level in order
to be able to load tables with FK references in the correct order.
Tables can then be loaded one level at a time from lower to higher.
This script also shows all the relationships for each table
by tables it references and by tables that reference it.