0

I try to create a SQL Server database snapshot (MSSQL EXPRESS 2012 SP #1) from Delphi (XE2) code. The code is executed without any problem but actually no snapshot file is created

Code example :

.... LoadStringfromFile(sqlFilename, sqlString);

sqlString := StringReplace(sqlString, 'db_snapshot_name', SnapshotName, []);
sqlString := StringReplace(sqlString, 'physical_file_name', SnapshotFolder, []);
sqlString := StringReplace(sqlString, 'logical_file_name', DatabaseName, []);
sqlString := StringReplace(sqlString, 'source_database_name', DatabaseName, []);

Memo1.Lines.Add(sqlString);  //  result see below .... 

ExecuteSQLQuery(sqlString);

SSStatusBar.SimpleText := ' run sql file done !  ';

end;

procedure TSnapShotForm.ExecuteSQLQuery(const sqlValue: string);
var
aSQLQuery: .....;
begin

  ///
  ///
aSQLQuery:=.......Create(self);

aSQLQuery.Active := false;

aSQLQuery.Connection := aConnection;

aSQLQuery.SQL.Add(sqlValue) ;

aSQLQuery.Active := true;

aSQLQuery.Free;

end;

the SQL Statement used with this text goes like this

     CREATE DATABASE test_ss
     ON (   NAME = 'test_evaluation', 
FILENAME = 'd:\test_ss')
     AS SNAPSHOT OF test_evaluation

Any good idea what is wrong here ?

jachguate
  • 16,976
  • 3
  • 57
  • 98
Franz
  • 1,883
  • 26
  • 47
  • You could use Connection.Execute(SQL); Does ist work in the MSSMS? Database Snapshot is not supported on Express Edition. – bummi Apr 26 '13 at 07:47

1 Answers1

3

Database Snapshot is not supported on Express Edition

Features Supported by the Editions of SQL Server 2012

bummi
  • 27,123
  • 14
  • 62
  • 101