Brett Kaiser (x002548) Blog

Not Just a Number - Brett Kaiser

Ghost records…..ooooooo….scary

OK, Gotta admit to being floored by this. First I would like to know how many people have heard of this. Second I would like to go on to describe what this is, how it happens, and how your Ghosts are exorcised. Read more →

Database Design based on existing data

I really like to avoid doing database design based on existing data structures. I really prefer to start with a functional flow of the business, target the data (be it existing electronic data, memo;s, post it's, whatever, data is data) for each function, organize all the data across functions into general entities, then take all of the data elemets or attributes and associate them with the higher level Entities. Read more →

SUBSTRING with Delimiters

I've been having to parse DB2 Load Cards and to extract a lot of data (Like starting postion, Length, Column name, ect) you need parse the data out of the card based on delimiters. Read more →

Fun with Dates (Date Conversion examples)

Update: 11/19/2009 No! Not that kind of fun with your date. It seems lately a lot of Date conversion questions have been popping up. So I'd thought I'd list them all here with their solutions and the author that has supplied them. Read more →

SQL Server MVP's

No Kidding...I should have guessed that Bill was one. There's a boat load of MVPs. Let's see who we know. OK so 85 ain't a boat load. I know or have spoken with Read more →

Remove a User From All Databases on a server

I'm sure Nigel or Tara alread have blogged this, but it was asked for and I scratched one up.Anyone have any horror stories with something like this? EDIT: If you look in that thread, you'll see Pat Phelan's use of sp_MSForEachDb. Read more →

Find a word in a string

By doing this with an identity Column on the row, you have a pseudo array for sql server. This user defined function will grab the nth occurance of a word in a string. Read more →

bcp out for Oracle

As of Oracle 8i (which I believe is no longer supported) there was no utility to unload data. I guess Oracle felt that once the got the data, there was no reason to relinquesh it. Read more →

Object Dependency Hierarchal Relationships

This always seems to pop as well. To determine what objects are dependant on what you can use sp_depends. Unfortunately that's for 1 level of relationships in either direction (to the parent or the child). Read more →

TRUNCATE TABLE in DB2

Well there isn't one. If you read this post and your platform is SQL Server or Oracle, I hope you feel very fortunate that you have TRUNCATE TABLE <tablename>. It appears that in version 8, there is a callable procedure that is supplied by IBM, but it cannot be executed as a standard SQL command. Read more →

CREATE TYPE2 UNIQUE WHERE NULL INDEX

This pops up every so often, as it does Here. The post title is the DB2 syntax for achieving a unique index that allows for nulls. I always felt that since Nulls are not equal to anything, not even themselves, then how could you get a dup key violation. Read more →

Show me The TOP n Number of things based on a key

OK, another one that seems to be often asked, and I'm sure there's a SQL Team article out there...I'm just lazy. Anyway, this post got me interested in this again (and I always have trouble trying to remember the answer), so I decided to post some solutions, so I don't have to remember. Read more →

Mimic Oracles INSTR Function

Starting at a user defined location in a string to find the nth occurance of a target string's starting location EDIT: OK, I got Jay's set based method to work. And I mistook Jay for Jay White (Page47) but I was wrong (but I should be given a pass, because it's just like what Mr. Read more →