Hi,
Getting ready to convert TPS to MSSQL. MSSQL has a record length of 8K chars. I want to see the lengths of my records in my TPS files to see what length they are. No blobs. So, question is what is the easiest way to get the length of the records in each of my 12 TPS files?
Thanks,
Ron
Ron, while SQL Server’s page size is limited to 8K (actual 8060 bytes of data), rows are no longer limited to this with “off-row” storage. Data types that are variable in length (VARCHAR, nVarchar, Varbinary) can be moved to a different page and referenced from the base row page via pointer. “Max” columns ( VARCHAR(MAX), nVarchar(MAX), Varbinary(MAX) ) are always stored “off-row” and do not count torwards the row size.
Where the limit still applies is to fixed length fields like INT, CHAR(n), etc.
As long as your records have large string columns, you can make them varchar(n) or varchar(max) in the database and CSTRING in Clarion.
Or some more technical articles that are interesting:
Rick’s answer aside, you can get the size of the record as
s = size(cus:record)
Hi,
The videos above provide lots of information. TPS has a record size limit of 15K bytes. MSSQL server simply stores records in 8K pages. These are linked together and managed by Server Engine. Seems like SERVER acts like TPS in that it packs as much info into an 8K chunk and then keeps a reference of the start of each chunk and then keep adding pages of 8K chunks. As I recall, TPS operates much like this - it just keeps adding records to the end of the line up to 15K bytes and indexes them. As Rick Martin said, the large VARCHAR like Varchar(MAX) can be very large!
Thanks for the pointers and insight.
Ron
A few other things to keep in mind.
You can’t use varchar(max) in an index.
There are also limitations on the sizes of indexes and primary keys to keep in mind Maximum Capacity Specifications for SQL Server - SQL Server | Microsoft Learn