Missing character when retrieving the stored procedure code using a query
Posted: 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 := '';
qrySysObjects.first;
while not qrySysObjects.Eof do begin
Str := Str + qrySysObjects.FieldByName('Text').AsString; //<<<<<------------Here we miss data when we entered the second time.
qrySysObjects.Next;
end;
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
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 := '';
qrySysObjects.first;
while not qrySysObjects.Eof do begin
Str := Str + qrySysObjects.FieldByName('Text').AsString; //<<<<<------------Here we miss data when we entered the second time.
qrySysObjects.Next;
end;
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