mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 11:26:01 +02:00
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 -
This commit is contained in:
parent
8e28dd52b4
commit
0ec6a79505
@ -144,6 +144,7 @@ procedure TSQLDBConnector.CreateFConnection;
|
|||||||
var t : TSQLConnType;
|
var t : TSQLConnType;
|
||||||
i : integer;
|
i : integer;
|
||||||
s : string;
|
s : string;
|
||||||
|
TempTrans: TSQLTransaction;
|
||||||
begin
|
begin
|
||||||
for t := low(SQLConnTypesNames) to high(SQLConnTypesNames) do
|
for t := low(SQLConnTypesNames) to high(SQLConnTypesNames) do
|
||||||
if UpperCase(dbconnectorparams) = SQLConnTypesNames[t] then SQLConnType := t;
|
if UpperCase(dbconnectorparams) = SQLConnTypesNames[t] then SQLConnType := t;
|
||||||
@ -198,6 +199,7 @@ begin
|
|||||||
|
|
||||||
FieldtypeDefinitions := FieldtypeDefinitionsConst;
|
FieldtypeDefinitions := FieldtypeDefinitionsConst;
|
||||||
|
|
||||||
|
// Server-specific initialization
|
||||||
case SQLServerType of
|
case SQLServerType of
|
||||||
ssFirebird:
|
ssFirebird:
|
||||||
begin
|
begin
|
||||||
@ -227,6 +229,20 @@ begin
|
|||||||
FieldtypeDefinitions[ftWideString] := 'NVARCHAR(10)';
|
FieldtypeDefinitions[ftWideString] := 'NVARCHAR(10)';
|
||||||
FieldtypeDefinitions[ftFixedWideChar] := 'NCHAR(10)';
|
FieldtypeDefinitions[ftFixedWideChar] := 'NCHAR(10)';
|
||||||
//FieldtypeDefinitions[ftWideMemo] := 'NTEXT'; // Sybase has UNITEXT?
|
//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;
|
end;
|
||||||
ssMySQL:
|
ssMySQL:
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user