T-SQL and client compatibility
Which client operation was tested?
| Client or API | Observed result | What to check for an application |
|---|---|---|
FreeTDS 1.5.18 tsql, TDS 7.4 | On the matching Rocky x86-64 build, password login, logical database selection, table DDL, two-row DML, a procedure call and TLS 1.2 worked. | Run the actual result sets and parameter types through the driver used in production. |
Microsoft JDBC 8.2.2.jre8 SQLServerBulkCopy | On a preceding integrated PG19 build with the same Babelfish extension tree, two integers reached an encrypted table. PG read 2 and 40. The bulk test used databaseName=master;encrypt=false on loopback. | Check server-side row counts and values. Re-test with the deployed JDBC version, TLS settings and real column types. |
FreeTDS 1.3.17 freebcp | On the standalone PG19 port and upstream beta, the utility reported two rows copied. The server rejected the bulk packet and stored zero. | Reconcile counts on the target. Use the exercised JDBC bulk path or parameterized inserts after testing them with the application. |
sqlcmd, SSMS, .NET SqlClient, ODBC and Python drivers | Upstream documents SQL Server clients. There is no complete application or driver-suite result for these tools on this Mimus build. | Check prepared RPCs, output parameters, result-set metadata, connection pooling and reset, cancellation and reconnect with the exact client version. |
Procedures and batches
In FreeTDS tsql as bbf_admin in master, after the two-row example, submit the definition and invocation as separate batches. The integer parameter 1 returned amount = 40 and return status 0. This exercises a T-SQL call sent as a SQL batch. Driver RPC calls, output parameters and multiple results take additional client paths.
For procedures using temporary objects, inventory each @table and #temp, including those in nested procedures. Compare success, error and rollback paths with the source application. Use a separate batch for each procedure definition and let the client consume GO. Drivers executing SQL strings generally need the caller to split batches.
The default escape hatches for index clustering and storage options are ignore. A migrated PRIMARY KEY CLUSTERED or filegroup clause can parse without reproducing SQL Server’s physical layout. Check the resulting indexes and query plans. Procedures that rely on equivalent locking or placement need a separate design. Upstream T-SQL settings
Types, text comparison and views
| Case | Observed behavior | Migration decision |
|---|---|---|
| Fractional time | On the earlier four-component tree, the nanosecond part of CAST('2000-01-01T12:34:56.1234567' AS datetime2(7)) was 123457000. SQL Server’s type can represent 100 ns. | If the seventh digit orders events or distinguishes keys, retain the source ticks in an integer or exact numeric column. |
ISNULL in a persisted view | On an earlier integrated build, with a nullable varchar(3) column and a varchar(6) replacement, the ISNULL view column kept the first input’s type modifier. COALESCE had no length modifier. A concatenated TDS query returned abcdef/abcdef for the NULL row. SQL Server documents possible truncation to the first argument’s type. | Specify the required result width explicitly. Check the returned value and the metadata through the application driver. |
| Collations and trailing spaces | The default server collation is sql_latin1_general_cp1_ci_as. In a PG19 comparison, native text under sys.bbf_unicode_cp1_ci_as and sys.bbf_unicode_cp1_cs_as agreed with matching ICU controls. Case differed between CI and CS. Both distinguished a trailing space. T-SQL varchar equality ignored the trailing space. | Replay joins, unique keys and orderings with case, accents, composed characters and trailing spaces. Carry the intended type and collation into native queries. |
| Numeric, monetary, binary and identifier types | The extensions supply SQL Server types and conversions, including money, uniqueidentifier, datetimeoffset and sql_variant. The integer bulk-copy result covers none of their wire encodings. | Round-trip decimal scale, Unicode, raw bytes, offsets, NULLs and the base type of variant values through the intended import path. |
TOP … PERCENT views | Four earlier PG19 TDS view cases returned 5, 7, 4 and 3 rows. They covered plain selection, unions and values. | Compare your view’s ordering and ties on real rows before relying on the selected subset. |
SQL Server datetime2 · SQL Server ISNULL · Upstream Babelfish data types
Transactions and temporary objects
In the PG19 integrated heap tests, each object started with 7. An explicit transaction added 4 and rolled back. The batch-local @table retained both rows (sum 11). A local #temp, SELECT INTO #temp and a persistent table each returned 7. A new batch also ends a table variable’s scope. Code that needs data in subsequent batches should choose its object and connection lifetime accordingly. The default encrypted access method changes whether these objects can be created. T-SQL temporary-object settings and storage
In a PG19 three-protocol concurrency test at READ COMMITTED, a TDS update waited on a locked integer primary key. An in-place change committed by the lock holder yielded one updated row. A committed delete and reinsert with the same key yielded zero for the waiting TDS update, even though the replacement row existed. The result held on heap and tde_heap. Compare @@ROWCOUNT and retry logic under the SQL Server application’s actual isolation settings. The concurrency run had no SQL Server reference instance. PostgreSQL transaction isolation