zoukankan      html  css  js  c++  java
  • 查询分析器Go语句

    查询分析器是sql客户端,它可以识别go用来分批提交,但go不是sql语句,sql服务器不能识别所以不能用在程序中。

    启用SQL自动备份

    function get_sql_ver(): Integer; //判断当前SqlServer版本

    var

    AQ: TADOQuery;

    ver: string;

    begin

    AQ := tadoquery.Create(nil);

    AQ.Connection := fdm.ADOCon;

    AQ.SQL.Text := 'master..xp_msver ProductVersion';

    AQ.Open;

    if AQ.RecordCount > 0 then

    begin

    ver := AQ.FieldValues['Character_Value'];

    result := strtoint(leftstr(ver, pos('.', ver) - 1));

    end

    else

    Result := 0;

    AQ.close;

    AQ.free;

    end;

    if get_sql_ver() > 8 then //sql2005以上版本需开启cmd开关才能运行

    begin

    lvtmp := Tstringlist.Create;

    try

    // EXEC sp_configure 'show advanced options', 1 GO

    // RECONFIGURE GO

    // EXEC sp_configure 'xp_cmdshell', 1 GO

    // RECONFIGURE GO

    // master..xp_cmdshell 'sc config SQLSERVERAGENT start= auto'

    // EXEC sp_configure 'xp_cmdshell', 0 GO

    // RECONFIGURE GO

    lvtmp.Clear;

    lvtmp.Add('EXEC sp_configure ''show advanced options'', 1 ');

    lvtmp.Add('RECONFIGURE ');

    lvtmp.Add('EXEC sp_configure ''xp_cmdshell'', 1 ');

    lvtmp.Add('RECONFIGURE ');

    lvtmp.Add('EXEC master..xp_cmdshell ''' + cmd + ''' ');

    lvtmp.Add('EXEC sp_configure ''xp_cmdshell'', 0 ');

    lvtmp.Add('RECONFIGURE ');

    Result := lvtmp.Text;

    finally

    lvtmp.Free;

    end;

    end

    else

    Result := 'master..xp_cmdshell ''' + cmd + ''' ';

    酒肉穿肠过 佛祖心中留 世人若学我 如同入魔道
  • 相关阅读:
    sqlite android
    cocos2dx 2.1.3 使用json
    cocos2dandroid 自动缩放、高清显示
    cocos2dx HttpClient
    coco2dx 2.1.3 之 使用网络请求
    facebook on android
    项目运行出错怎么办?
    Bug应对策略 本文系转
    从网页中导入Excel
    ASP.NET HTTP运行时组成详解[转帖]
  • 原文地址:https://www.cnblogs.com/jspdelphi/p/8024201.html
Copyright © 2011-2022 走看看