From 0ec6a795052c3ac9a8397a09dd65c78dba8adb47 Mon Sep 17 00:00:00 2001 From: reiniero Date: Tue, 4 Mar 2014 13:08:33 +0000 Subject: [PATCH] fcl-db: dbtestframework: MS SQL Server: * Create tables allowing NULL values for non-primary keys * Increase blob size per documentation in order to support large blobs git-svn-id: trunk@26950 - --- packages/fcl-db/tests/sqldbtoolsunit.pas | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/fcl-db/tests/sqldbtoolsunit.pas b/packages/fcl-db/tests/sqldbtoolsunit.pas index 8a2128eb8e..23346dbe4d 100644 --- a/packages/fcl-db/tests/sqldbtoolsunit.pas +++ b/packages/fcl-db/tests/sqldbtoolsunit.pas @@ -144,6 +144,7 @@ procedure TSQLDBConnector.CreateFConnection; var t : TSQLConnType; i : integer; s : string; + TempTrans: TSQLTransaction; begin for t := low(SQLConnTypesNames) to high(SQLConnTypesNames) do if UpperCase(dbconnectorparams) = SQLConnTypesNames[t] then SQLConnType := t; @@ -198,6 +199,7 @@ begin FieldtypeDefinitions := FieldtypeDefinitionsConst; + // Server-specific initialization case SQLServerType of ssFirebird: begin @@ -227,6 +229,20 @@ begin FieldtypeDefinitions[ftWideString] := 'NVARCHAR(10)'; FieldtypeDefinitions[ftFixedWideChar] := 'NCHAR(10)'; //FieldtypeDefinitions[ftWideMemo] := 'NTEXT'; // Sybase has UNITEXT? + + TempTrans:=TSQLTransaction.Create(nil); + FConnection.Transaction:=TempTrans; + TempTrans.StartTransaction; + // Proper blob support: + FConnection.ExecuteDirect('SET TEXTSIZE 2147483647'); + // When running CREATE TABLE statements, allow NULLs by default - without + // having to specify NULL all the time: + // http://msdn.microsoft.com/en-us/library/ms174979.aspx + FConnection.ExecuteDirect('SET ANSI_NULL_DFLT_ON ON'); + TempTrans.Commit; + TempTrans.Free; + FConnection.Transaction:=nil; + end; ssMySQL: begin