如何得知 資料庫 的 Logical file name ?

方法有二:

1. restore filelistonly from disk='E:\DBBackup\20100912\IEDB09_20100912\IEDB09-2010-09-12.bak'
===>
IEDB09_Data     d:\Program Files\Microsoft SQL Server\MSSQL\data\IEDB09.mdf   
IEDB09_Log      d:\Program Files\Microsoft SQL Server\MSSQL\data\IEDB09_log.ldf

 

2. 在 SQL Server Enterprise Manager 中操作

image

image

image

openFileDialog 多檔案設定

openFileDialog1.Title = "File UpLoad";
openFileDialog1.Filter = "圖檔(*.TIF)|*.TIF|" +
                         "圖檔(*.PDF)|*.PDF";                    
openFileDialog1.Multiselect = true;

cntWEB05A["file_name"] = "";
wFileCount = 0;

DialogResult dr = openFileDialog1.ShowDialog();
if (dr == System.Windows.Forms.DialogResult.OK)
{
    foreach (String file in openFileDialog1.FileNames)
    {
        try
        {
            cntWEB05A["file_name"] += file + "\r\n";
            wFileCount++;
        }
        catch (System.Exception ex)
        {
            MessageBox.Show("cmdPath_Click" + ex.Message);
        }
    }
    cntWEB05A["file_name"] = cntWEB05A["file_name"].ToString().Substring(0, cntWEB05AH["file_name"].ToString().Length - 2);
}
lblFileCnt.Text = "上傳合計:" + wFileCount.ToString("0000") + " 筆";
cntWEB05A.Update();

噗浪呀 噗的技巧

私密回噗
@英文帳號:(空格) 回噗內容
例如:   @frank: 週六記得回覆!!

粗體效果
**粗體效果的文字內容**

斜體效果
*斜體效果的文字內容*

底線效果
_底線效果的文字內容_

網址連結
http://www.shadowgov.tw (影子政府)
影子政府

在文中連結噗友頁面
在噗文時輸入語法:在@後面加上噗友帳號,就可以讓噗友直接點選藍色文字後連到你所指向的噗反頁面。
例如輸入: @bigbear222

用手機噗
http://www.plurk.com/m/u/perton

OLE DB Connect String

連線到資料庫的 OLE DB 用法,一般來說,可以使用:
1. *.udl 連線字串記錄檔
2. 程式中直接用連線字串

以下是各類型資料庫連線字串的範例:

  1. MySQL
    Provider=OleMySql.MySqlSource.1;Persist Security Info=False;User ID=root;Data Source=localhost;Activation="";Mode=Read;Trace="";Initial Catalog=db;Command Time Out=600
  2. SQL Server
    Provider=SQLOLEDB.1;Password=_pw_;Persist Security Info=True;User ID=_id_;Initial Catalog=_db name_;
    Data Source=_ip_ or . or _電腦名稱_ or (local)
  3. Access 97
    Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;
    Data Source=C:\mdb\books.mdb
  4. Access 2000 (有設定密碼)
    Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;
    Data Source=C:\mdb\books.mdb;
    Jet OLEDB:Database Password=_pw_

重新初始化同步表

重新初始化同步表的動作,有幾個步驟:

1. 在 DB 主機中,找到要重新初始化的同步項目

image

2. 在 同步 主機中,Replication Monitor / Agents / Snapshot Agents 指定要初始化的項目,並啟動代理功能。

image

3. 如此設定後,運行的結果會是重建 同步臨時表 (所以原本在臨時表中的 Trigger 會被移除)
    對此, 要事先保留相關的 Trigger 設定。

資料表的 Trigger 啟動與禁止

對於資料庫中的任何一個資料表,若是先前有設定過 Tirgger 程序,有時候需要禁用或啟用,該下什麼指令?

禁用:
alter table Table_Name disable trigger all

啟動:
alter table Table_Name enable trigger all