Missing character when retrieving the stored procedure code using a query

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Olivier Olmer (Oxolutions

Missing character when retrieving the stored procedure code using a query

Post by Olivier Olmer (Oxolutions » Thu 23 Feb 2006 11:53

With the following query we miss data when we query for the storedprocedures text being very large See example code:
qrySysObjects := TMSQuery.Create(Self)
qrySysObjects.Connection := Connection;
qrySysObjects.Sql.Text := ‘Select Name, Text From SysObjects join syscomments on Syscomments.id = sysobjects.id where Name = :Name order by ColId'

qrySysObjects.active := False;
qrySysObjects.ParamByName('Name').AsString := StoredProcName;
qrySysObjects.active := True;
Str := '';

while not qrySysObjects.Eof do begin
Str := Str + qrySysObjects.FieldByName('Text').AsString; //<<<<<------------Here we miss data when we entered the second time.

Steps to reproduce:
--Create a procedure exceeding 2048 characters
--Get the procedure using our example
-- and you will notice a difference between the text retrieved and the text of the actual storedproc.

This problem is introduced in the version which I retrieved on februari 14 th 2006 and did not occur in version 3.6

We are using Delphi 5 with Sql Server 2000

With kind regards,

Olivier Olmer

Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 24 Feb 2006 13:40

Thank you for information.
We reproduced your problem and fixed it. This fix will be included in the next SDAC build. It will be available in about two weeks. Please watch for announcements at the forum

Post Reply