anchor.diff:  unit mSQLServerSQLDialect;
   
   {$IFDEF FPC}
  -{$MODE DELPHI}
  +  {$MODE DELPHI}
   {$ENDIF}
   
   interface
  
positive.code: function DateToSQLString(aValue : TDate) : String;
  function FloatToSQLString(aValue : Double): String;
  function StringToSQLString(aValue : String): String;
  
  
  implementation
  
  uses
    DateUtils, SysUtils, mUtility;
  
  function DateTimeToSQLString (aValue : TDateTime) : String;
  var
  
negative.code:   Result := '''' + StringReplace(aValue, '''', '''''', [rfReplaceAll]) + '''';
  end;
  
  function WideStringToSQLString(aValue: WideString): String;
  var
    tmp, tmp2 : WideString;
    sqlString : WideString;
  begin
    tmp := LazUTF8.UTF8ToUTF16('''');
    tmp2 := LazUTF8.UTF8ToUTF16('''''');
    sqlString := LazUTF8.UTF8ToUTF16('''') + WideStringReplace(aValue, tmp, tmp2, [rfReplaceAll]) + tmp;
    Result := LazUTF8.UTF16ToUTF8(sqlString);
  end;
  
  end.
  