查詢分析器Go語句

2022-05-02 06:00:09 字數 1507 閱讀 8520

查詢分析器是sql客戶端,它可以識別go用來分批提交,但go不是sql語句,sql伺服器不能識別所以不能用在程式中。

啟用sql自動備份

function get_sql_ver(): integer; //判斷當前sqlserver版本

varaq: 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));

endelse

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;

endelse

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

Access查詢分析器

前一段時間在用asp.net和access資料庫做乙個 時,經常需要驗證一些複雜的sql語句的和期望的結果一樣。但是access資料庫又沒有像sql server和oracle等資料庫執行sql語句的查詢分析器,每次執行sql時都要瀏覽器開啟網頁檢視結果,很不方便。於是我就做了個可以執行sql語句並...

10 查詢分析器

1.簡介 explain命令可以檢視sql語句的執行計畫。當explain與sql語句一起使用時,mysql將顯示執行計畫的相關資訊。也就是說,mysql解釋了它將如何處理語句 如何聯接表以及以何種順序聯接表的資訊。2.功能 查詢分析器提供包括分析表讀取順序 資料讀取的操作型別 索引實際使用情況 表...

oracle 查詢分析器的使用

以下文字均來自網上,自己做個備份,免得需要時找不到。index unique scan 與index range scan等的區別 訪問oracle當中掃瞄資料的方法 一 oracle 是乙個面向internet計算環境的資料庫。它是在資料庫領域一直處於領先地位的甲骨文公司的產品。可以說oracle...