Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is an example. I've tested it with D7 and MSSQL2000. And it adds to Memo1 all messages from server:</p> <pre><code>29 percent backed up. 58 percent backed up. 82 percent backed up. 98 percent backed up. Processed 408 pages for database 'NorthWind', file 'Northwind' on file 1. 100 percent backed up. Processed 1 pages for database 'NorthWind', file 'Northwind_log' on file 1. BACKUP DATABASE successfully processed 409 pages in 0.124 seconds (26.962 MB/sec). </code></pre> <p>Also if it takes a long time consider to implement a WHILE loop not in the main thread.</p> <pre><code>uses AdoInt,ComObj; ..... procedure TForm1.Button1Click(Sender: TObject); var cmd : _Command; Conn : _Connection; RA : OleVariant; rs :_RecordSet; n : Integer; begin Memo1.Clear; Conn := CreateComObject(CLASS_Connection) as _Connection; Conn.ConnectionString := 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=NorthWind;Data Source=SQL_Server'; Conn.Open(Conn.ConnectionString,'','',Integer(adConnectUnspecified)); cmd := CreateComObject(CLASS_Command) as _Command; cmd.CommandType := adCmdText; cmd.Set_ActiveConnection(Conn); cmd.CommandText := 'BACKUP DATABASE [NorthWind] TO DISK = N''c:\sql_backup\NorthWind'' WITH INIT , NOUNLOAD , NAME = N''NortWind backup'', NOSKIP , STATS = 10, NOFORMAT;'; rs:=cmd.Execute(RA,0,Integer(adCmdText)); while (rs&lt;&gt;nil) do begin for n:=0 to(Conn.Errors.Count-1)do begin Memo1.Lines.Add(Conn.Errors.Item[n].Description); end; rs:=rs.NextRecordset(RA); end; cmd.Set_ActiveConnection(nil); Conn.Close; cmd := nil; Conn := nil; end; </code></pre> <p>I've found <a href="http://www.sql.ru/forum/actualthread.aspx?bid=20&amp;tid=92662#676355" rel="noreferrer">this thread (Russian)</a> for stored procedure and correct it for BACKUP command.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload