Category Archives: Tools and Tricks

Tools and tricks for common computer mishaps.

Unix – beginnings

Today, we covered in class – basic commands for unix. Log into the system, run id and pwd to discover location and who you are connected as. users need to belong to at least one group id -a id -a … Continue reading

Posted in Tools and Tricks, Unix | Tagged | 1 Comment

Check existing databases then create

— CHECK existing databases for existence. if exists (select * from master..sysdatabases where name = ‘dbName’ ) drop database dbName GO create database dbName on primary (name = ‘dbName’, filename = ‘C:\data\dbName.mdf’), log on (name = ‘dbNameLOG’, filename = ‘C:\data\dbName.ldf’) … Continue reading

Posted in SQL, Tools and Tricks | Tagged | Comments Off on Check existing databases then create

Objects Query

/* Select ALL table names and column names from a given table. */ select o.name as [TableName], c.name as [ColumnName] from sys.objects o inner join sys.columns c ON o.object_id = c.object_id where 0=0 and type = ‘U’ — and c.name … Continue reading

Posted in SQL, Tools and Tricks | Tagged | Comments Off on Objects Query

Data and log file iteration

——————————————————————– — This will generate a list of databases to iterate through and pull — data and log file locations, plus size, etc. — There are 2 parts. 1 generates the list and 2 creates the output. ——————————————————————– /* PART … Continue reading

Posted in SQL, Tools and Tricks | Tagged | Comments Off on Data and log file iteration

Check Space

—————————————————- — WORK IN PROGRESS — xp_fixeddrives joined with sys.masterfiles view — Looking at space, judging db size, growth and — free space on the server. — use sp_helpfile for SQL 2000 —————————————————- set nocount on declare @fixeddrives table — … Continue reading

Posted in SQL, Tools and Tricks | Tagged | Comments Off on Check Space

Checking Active Partition – Windows 7

Sometimes the partition in question is not recognized by the WinRE (Windows Recovery Environment) or you receive “missing operating system”, “Bootmgr is missing”, or something comparable. In this case, you need to load the startup repair disc. See the link … Continue reading

Posted in Tools and Tricks | Tagged | Comments Off on Checking Active Partition – Windows 7

Windows 7 Startup Repair Disc

The bad news is that this is not readily available in most cases, as the operating system is pre-installed, and (in most cases) the operating system disc is not included when you purchase a desktop/PC. What this means is that … Continue reading

Posted in Tools and Tricks | Tagged , | Comments Off on Windows 7 Startup Repair Disc