Brett Kaiser (x002548) Blog

Not Just a Number - Brett Kaiser

Deltas

It's all about the update... EDIT: 9/9/2004: Well that wasn't much of an explanation. What the hell are deltas.....is it a place in Mississippi where they have great music and food? Read more →

Mille Bournes

From a SQLTeam freind, Thanks Duane http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=9857 QA Needs to be set to text mode and font courier SET NOCOUNT ON DECLARE @InpString VARCHAR(4000)DECLARE @CharCT INTDECLARE @PrevY INTDECLARE @CurrX INTDECLARE @CurrY INTDECLARE @InpRow VARCHAR(4000)DECLARE @RowCT INT Read more →

Sanitize input files

I had a devil of a time with the spawned thread blocking from xp_cmdshell and doing bcp's....  Sometime it would work, other times not... The sproc is treated as 1 logical unit of work. Read more →

Come on Weekend!

CREATE FUNCTION Weekend (@Date Datetime)RETURNS datetimeASBEGINDECLARE @Weekend datetime IF (SELECT 6-DATEPART(dw,@Date)) < 0 BEGIN SELECT @Weekend =  CONVERT(datetime , CONVERT(varchar(10) , (DATEADD(dd , 13-DATEPART(dw,@Date) , @date)), 120) + ' 17:00:00') END ELSE BEGIN--Handles Friday itselfIF (SELECT 6-DATEPART(dw,@Date)) = 0 BEGIN --for after 1700 but before midnight IF (SELECT DATEDIFF(ss, @date , CONVERT(datetime, CONVERT(varchar(10) , @Date, 120)) + ' 17:00:00')) < 0 BEGIN SELECT @Weekend = CONVERT(datetime , CONVERT(varchar(10) , (DATEADD(dd, 13-DATEPART(dw,@Date) , @date)), 120) + ' 17:00:00') END ELSE --for before 1700 on Friday BEGIN SELECT @Weekend = CONVERT(datetime , CONVERT(varchar(10), @Date, 120) + ' 17:00:00') END END ELSE --Handles days before Friday BEGIN SELECT @Weekend = CONVERT(datetime , CONVERT(varchar(10) , (DATEADD(dd, 6-DATEPART(dw,@Date) , @Date)), 120) + ' 17:00:00') ENDENDReturn @WeekendENDGO Read more →

The Interview

I've decided to start a list of questions for canidates (or so I can remeber when I gotta go)...ones that I've run across and was confused by (yeah, yeah, there's not enough drive space available. Read more →

Interogate Sprocs

Seen a bunch of people interested in Searching through Sprocs lately. Thought it would be handy (especially for some of these god awful legacy database we're so fortunate to inherit. Read more →

Calculate the most effecient Storage size based on the catalog

The Following code is used to identify reccomended allocations, whether it be in Cylinders or tracks, and how much to allocate for a tablespace.  SELECT NAME  , NACTIVE*PGSIZE AS KILOBYTES  , PGSIZE AS PAGE_SIZE  , NACTIVE AS PAGES  , DECIMAL((NACTIVE/12. Read more →

Important stuff First!

OK, How did Rob Alter his BLOG..very cool...right now I'm counting lines of code... Why? Because...someone hired Deloitte and Touche..  Anyway..back to the important things in life:  The Perfect Margarita 1) Fill shaker with broken cubed ice 2) Squeeze 2 fresh lime wedges into shaker 3) Add 2 oz. Read more →

Welcome!

Hey, my first BLOG. Hope I can post some interesting and useful stuff here. Let's see…where is that Margarita recipe… Legacy Comments SamC 2004-01-30 re: Welcome! Read more →