Brett Kaiser (x002548) Blog

Not Just a Number - Brett Kaiser

sp_depends for DB2

Well, there really isn't anything that I know of that is like sp_depends for DB2 z/OS Version 7.2. Hopefully V8 will alot more features...but for Now you have to interogate the catalog. Read more →

How do I track data changes in a database

This question comes up quit often. For example in this thread from dbForums SQL Server forum they are looking to do just that. The simplest answer is to create a history for every table, then create a trigger for each that will move the entire row of the before image information into history when a DELETE or UPDATE Modification occurs. Read more →

How to FTP Files to OS/390

The best way I've found to transfer is to use ftp with a script file. Now with Cyberfusion being implemented, I unfortunately have to abandon this simple methd for secure file transfers. Read more →

T-SQL HTML? Parser

EDIT: Ok, so as is pointed out in the comments below SQL Server comes with a very powerful XML Parser already OPENXML and sp_xml_preparedocument. I posted a code snipet in the comments I got from BOL so you can see how it works. Read more →

How do I create a file with a header and trailer?

...was recently asked at SQLTeam http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=68461 This is what I would do USE NorthwindGO CREATE VIEW EXPORT_ORDERSASSELECT 1 AS ROW_ORDER,  'HEADER '  + CONVERT(char(25),GetDate()) AS Data_LineUNION ALLSELECT 2 AS ROW_ORDER, COALESCE(CONVERT(char(15),OrderID),'') + COALESCE(CustomerID,'') + COALESCE(CONVERT(char(15),EmployeeID),'') + COALESCE(CONVERT(char(25),OrderDate),'') + COALESCE(CONVERT(char(25),RequiredDate),'') + COALESCE(CONVERT(char(25),ShippedDate),'') + COALESCE(CONVERT(char(15),ShipVia),'') + COALESCE(CONVERT(char(15),Freight),'') + COALESCE(CONVERT(char(80),ShipName),'') + COALESCE(CONVERT(char(120),ShipAddress),'') + COALESCE(CONVERT(char(30),ShipCity),'') + COALESCE(CONVERT(char(30),ShipRegion),'') + COALESCE(CONVERT(char(20),ShipPostalCode),'') + COALESCE(CONVERT(char(30),ShipCountry),'') AS Data_Line FROM OrdersUNION ALLSELECT 3 AS ROW_ORDER, 'TRAILER '  + CONVERT(char(25),GetDate()) + CONVERT(char(15),COUNT(*)) AS Data_Line FROM OrdersGO Read more →

Sidekick? What the hell is a sidekick?

At first I thought it was a Suzuki... http://www.edmunds.com/new/suzuki/index.html?mktcat=makemodel-suzuki&kw=suzuki+sidekick&mktid=ga471651 I was like, Damn they left their suzuki in a taxi...wait, let me read that again..So this is what it is Read more →

Generate Fixed Width Format Cards

CREATE PROC isp_GenFormatCards AS DECLARE FormatCard CURSOR FOR SELECT FORMAT_CARD, TABLE_NAME, TABLE_SCHEMA FROM ( /* SELECT '--' + TABLE_NAME AS FORMAT_CARD , TABLE_NAME, null AS COLUMN_NAME, 0 AS SQLGroup, 1 AS RowGrouping FROM INFORMATION_SCHEMA. Read more →

Thank You Email to the NYC Straphangers

Charity, Just wanted to take a moment to say thank you for your correspondence. It seems it took very little effort to affect change once we formed as a community. While we are small in numbers, I would assume that the majority of the West Orange Ridership Community are also straphangers as well. Read more →