區域網內兩sqlserver資料庫資料匯入

2021-04-20 05:14:35 字數 2576 閱讀 1736

從一台機器上的資料庫將表的內容導到另一太機器上的資料庫相應表中:

--以下例子中ydh3為精通分店資料庫伺服器機器名,yedh為神通資料庫伺服器機器名.跑前把這兩個名字全部替換成實際機器名.

sp_addlinkedserver ydh3

godelete from ydh3.evideobill_sh.dbo.ktv_tbl_customer

delete from ydh3.evideobill_sh.dbo.bl_tbl_membergrade

go--導會員表資訊

insert into ydh3.evideobill_sh.dbo.ktv_tbl_customer(memberid,customerid,customername,***,*****type,*****number,dialnumber,address,cardtypeid,cardnum,balance,createdate,remark,birthdate,relationphone,gradeid,memberpsw,memberaccounttotal,memberaccountid,cardtooltype,status,totalintegral,carnum,memberaccountoverdraft,cardintegral,memberaccountbalance)

select memberid,customerid,customername,***,*****type,*****number,dialnumber,address,cardtypeid,cardnum,balance,createdate,remark,birthdate,relationphone,gradeid,memberpsw,memberaccounttotal,memberaccountid,cardtooltype,status,totalintegral,carnum,memberaccountoverdraft,cardintegral,memberaccountbalance

from yedh.evideoktv.dbo.ktv_tbl_customer  ----匯入時請將這裡的evideoktv替換成實際的資料庫名   

goif exists(select parametervalue from  ydh3.evideobill_sh.dbo.bl_tbl_systemparameter where parametername = 'shopno' and parametervalue is not null and parametervalue <> '')

update ydh3.evideobill_sh.dbo.ktv_tbl_customer set catenationid = (select parametervalue from ydh3.evideobill_sh.dbo.bl_tbl_systemparameter where parametername = 'shopno')

else

update ydh3.evideobill_sh.dbo.ktv_tbl_customer set catenationid = 1

go----導會員等級表資料酒水折扣和包廂折扣均取原來的等級折扣

insert into ydh3.evideobill_sh.dbo.bl_tbl_membergrade(gradeid,gradecode,gradename,winerebate,roomrebate,gradestatus,roomchargediscount,hourchargediscount,winechargediscount)

select gradeid,gradecode,gradename,graderebate,graderebate,gradestatus,roomchargediscount,hourchargediscount,winechargediscount

from yedh.evideoktv.dbo.bl_tbl_membergrade ----匯入時請將這裡的evideoktv替換成實際的資料庫名     

go--更新會員卡號對應主鍵id

update ydh3.evideobill_sh.dbo.bl_tbl_primarykeymake set primarykeyvalues = (select max(customerid) from yedh.evideoktv.dbo.ktv_tbl_customer) where primarykeyname = 'customerid'

go--更新會員標識對應主鍵id

update ydh3.evideobill_sh.dbo.bl_tbl_primarykeymake set primarykeyvalues = (select max(memberid) from ydh3.evideobill_sh.dbo.ktv_tbl_customer) where primarykeyname = 'memberid'

go--更新會員帳戶對應主鍵id

update ydh3.evideobill_sh.dbo.bl_tbl_primarykeymake set primarykeyvalues = (select max(memberaccountid) from ydh3.evideobill_sh.dbo.ktv_tbl_customer) where primarykeyname = 'memberaccountid'

go

偵聽區域網內密碼

只需在前面的網路嗅探程式基礎上,新增對搜尋出的埠號進行的增加功能即可 如下 在decodeippacket中新增 switch ntohs ptcphdr destinationport break case80 case 8080 break void getftp char pdata.dwor...

偵聽區域網內密碼

只需在前面的網路嗅探程式基礎上,新增對搜尋出的埠號進行的增加功能即可 如下 在decodeippacket中新增 switch ntohs ptcphdr destinationport break case80 case 8080 break void getftp char pdata.dwor...

Windows 區域網內共享

在區域網內,其它成員無需密碼就可以訪問某台計算機共享的某個磁碟或某個資料夾。本文記錄幾個關鍵點,共享端 需要共享的計算機 使用者端 從共享計算機讀取檔案的計算機 1 選中我的電腦圖示 右鍵 計算機管理,開啟計算機管理介面 2 選擇本地使用者和組 使用者雙擊guest,去掉帳戶已禁用 1 開啟控制面板...