SQLSite

CodeSite 2, from Raize Software , is a powerful debugging tool for Borland Delphi and C++Builder. The problem? Often not all of the logic in your application is contained in Delphi or C++Builder code. Some logic is often contained in Stored Procedures and Triggers. However, by itself, CodeSite will only let you trace the flow of execution to the boundary of your Delphi or C++Builder code. What goes on inside your database is pretty much a mystery to CodeSite.

Well, SQLSite tries to fix that. SQLSite is an extension to CodeSite 2, allowing CodeSite messages to be sent from within MS SQL Server Stored Procedures and Triggers. Now you can trace the flow of logic from your Delphi code to your Stored Procedure and back to your Delphi code, making it much easier to track down errors in your applications.

Requirements

SQLSite has been tested with CodeSite 2 Professional and SQL Server 7. I’m not taking advantage of any of the features not present in CodeSite 2 Standard, so I believe it should also work with the Standard Edition. Additionally, SQL Server has had Extended Stored Procedure support for a number of versions, so I believe it should also work with other versions of SQL Server. As I try it out with more versions, I’ll post the results.

Example

As an example, the following test Stored Procedure:

create proc TestCS
AS
declare @callresult integer
  exec csClear
  exec csCategoryColor 'clWhite'
  exec csEnterMethod 'TestCS'
  exec csCategory 'SQLSite Test'
  exec csAddCheckPoint
  exec csResetCheckpoint
  exec csAddCheckPoint
  exec csAddSeparator
  exec csSendMemoryStatus
  exec csSendMsg 'Msg'		
  exec csDisable
  exec csSendMsg 'Should not see this'		
  exec csEnable
  exec csCategoryColor 'clYellow'		
  exec @callresult = csEnabled
  if (@callresult = 1)
    exec csSendMsg 'CodeSite Already Enabled'		
  else		
  begin		
    exec csEnable    
    exec csSendMsg 'Just Enabled CodeSite'
  end		
  exec csSendMsg 'Should see this'		
  exec csSendString 'String', 'Value'		
  exec csSendInteger 'Integer', 1
  exec csSendFloat 'Float', 1.1
  exec csSendNote 'This is a test note'		
  exec csWriteInteger 'First', 'Integer', 1
  exec csWriteFloat 'Second', 'Float', 1.1
  exec csWriteString 'Third', 'String', 'Value'		
  exec csWriteMsg 'Fourth', 'Msg'		
  exec csExitMethod 'TestCS'

produces the following output in the CodeSite 2 viewer:

Click image for larger screenshot

Currently, SQLSite supports the following CodeSite 2 calls, inside your SQL Server code. This seems to cover most requirements, but let me know if you simply can’t live without support for something else.

CodeSite
SQLSite Equivalent
CodeSite.Category csCategory
CodeSite.CategoryColor csCategoryColor
CodeSite.AddSeparator csAddSeparator
CodeSite.AddCheckpoint csAddCheckpoint
CodeSite.ResetCheckpoint csResetCheckpoint
CodeSite.SendMemoryStatus csSendMemoryStatus
CodeSite.Clear csClear
CodeSite.Enabled := True csEnable
CodeSite.Enabled := False csDisable
CodeSite.Enabled csEnabled
CodeSite.DestinationDetails csDestinationDetails
CodeSite.EnterMethod csEnterMethod
CodeSite.ExitMethod csExitMethod
CodeSite.SendMsg csSendMsg
CodeSite.SendString csSendString
CodeSite.SendInteger csSendInteger
CodeSite.SendFloat csSendFloat
CodeSite.SendNote csSendNote
CodeSite.WriteInteger csWriteInteger
CodeSite.WriteFloat csWriteFloat
CodeSite.WriteString csWriteString
CodeSite.WriteMsg csWriteMsg

History

v1.0 – 28 August 2001

  • Initial Public Release

Download

CodeSite is a trademark of Raize Software .
SQL Server is a trademark of Microsoft