Reputation: 2049
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 ?
Upvotes: 0
Views: 1500
Reputation: 27385
Database Snapshot is not supported on Express Edition
Features Supported by the Editions of SQL Server 2012
Upvotes: 3