?? comyear.sql
字號:
/*******************************************************************************/
/* Views For Communication */
/*******************************************************************************/
sp_dboption 'sypos2000','select into/bulkcopy','true'
go
use sypos2000
go
if (select count(*) from sysobjects where name='com_goods')>0
DROP TABLE com_goods
if (select count(*) from sysobjects where name='com_deldata')>0
DROP TABLE com_deldata
if (select count(*) from sysobjects where name='com_team')>0
DROP TABLE com_team
if (select count(*) from sysobjects where name='com_class')>0
DROP TABLE com_class
if (select count(*) from sysobjects where name='com_vendor')>0
DROP TABLE com_vendor
if (select count(*) from sysobjects where name='com_cust')>0
DROP TABLE com_cust
if (select count(*) from sysobjects where name='com_worktype')>0
DROP TABLE com_worktype
if (select count(*) from sysobjects where name='com_staff')>0
DROP TABLE com_staff
if (select count(*) from sysobjects where name='com_staffauth')>0
DROP TABLE com_staffauth
if (select count(*) from sysobjects where name='com_membercard')>0
DROP TABLE com_membercard
if (select count(*) from sysobjects where name='com_import')>0
DROP TABLE com_import
if (select count(*) from sysobjects where name='com_alloc')>0
DROP TABLE com_alloc
if (select count(*) from sysobjects where name='com_sale')>0
DROP TABLE com_sale
if (select count(*) from sysobjects where name='com_adjust')>0
DROP TABLE com_adjust
if (select count(*) from sysobjects where name='com_req')>0
DROP TABLE com_req
if (select count(*) from sysobjects where name='com_orders')>0
DROP TABLE com_orders
if (select count(*) from sysobjects where name='com_importdetail')>0
DROP TABLE com_importdetail
if (select count(*) from sysobjects where name='com_allocdetail')>0
DROP TABLE com_allocdetail
if (select count(*) from sysobjects where name='com_saledetail')>0
DROP TABLE com_saledetail
if (select count(*) from sysobjects where name='com_adjustdetail')>0
DROP TABLE com_adjustdetail
if (select count(*) from sysobjects where name='com_orderdetail')>0
DROP TABLE com_orderdetail
if (select count(*) from sysobjects where name='com_deptretail')>0
DROP TABLE com_deptretail
if (select count(*) from sysobjects where name='com_cardconsume')>0
DROP TABLE com_cardconsume
if (select count(*) from sysobjects where name='com_loss')>0
DROP TABLE com_loss
if (select count(*) from sysobjects where name='com_lossdetail')>0
DROP TABLE com_lossdetail
if (select count(*) from sysobjects where name='com_paymode')>0
DROP TABLE com_paymode
if (select count(*) from sysobjects where name='com_deptps')>0
DROP TABLE com_deptps
if (select count(*) from sysobjects where name='com_userdeffield')>0
DROP TABLE com_userdeffield
if (select count(*) from sysobjects where name='com_ordersrights')>0
DROP TABLE com_ordersrights
if (select count(*) from sysobjects where name='com_reachrights')>0
DROP TABLE com_reachrights
if (select count(*) from sysobjects where name='com_adjustrights')>0
DROP TABLE com_adjustrights
if (select count(*) from sysobjects where name='com_category')>0
DROP TABLE com_category
if (select count(*) from sysobjects where name='com_topandbottom')>0
DROP TABLE com_topandbottom
if (select count(*) from sysobjects where name='com_deptstock')>0
DROP TABLE com_deptstock
if (select count(*) from sysobjects where name='com_vendorprice')>0
DROP TABLE com_vendorprice
if (select count(*) from sysobjects where name='com_custprice')>0
DROP TABLE com_custprice
if (select count(*) from sysobjects where name='com_grouprights')>0
DROP TABLE com_grouprights
if (select count(*) from sysobjects where name='com_dayreport')>0
DROP TABLE com_dayreport
if (select count(*) from sysobjects where name='com_cardflow')>0
DROP TABLE com_cardflow
if (select count(*) from sysobjects where name='com_depttablerights')>0
DROP TABLE com_depttablerights
if (select count(*) from sysobjects where name='com_subimport')>0
DROP TABLE com_subimport
if (select count(*) from sysobjects where name='com_subimportdetail')>0
DROP TABLE com_subimportdetail
if (select count(*) from sysobjects where name='nosubimportdetail')>0
DROP TABLE nosubimportdetail
go
SELECT * INTO com_goods FROM sypos..goods WHERE 1=2
SELECT * INTO com_deldata FROM sypos..deldata WHERE 1=2
SELECT * INTO com_team FROM sypos..team WHERE 1=2
SELECT * INTO com_class FROM sypos..class WHERE 1=2
SELECT * INTO com_vendor FROM sypos..vendor WHERE 1=2
SELECT * INTO com_cust FROM sypos..cust WHERE 1=2
SELECT * INTO com_worktype FROM sypos..worktype WHERE 1=2
SELECT * INTO com_staff FROM sypos..staff WHERE 1=2
/* SELECT * INTO com_staffauth FROM sypos..staffauth WHERE 1=2 */
/* SELECT * INTO com_membercard FROM sypos..membercard WHERE 1=2 */
SELECT * INTO com_paymode FROM sypos..paymode WHERE 1=2
SELECT * INTO com_userdeffield FROM sypos..userdeffield WHERE 1=2
SELECT * INTO com_ordersrights FROM sypos..ordersrights WHERE 1=2
SELECT * INTO com_reachrights FROM sypos..reachrights WHERE 1=2
SELECT * INTO com_adjustrights FROM sypos..adjustrights WHERE 1=2
SELECT * INTO com_category FROM sypos..category WHERE 1=2
SELECT * INTO com_topandbottom FROM sypos..topandbottom WHERE 1=2
SELECT * INTO com_deptps FROM sypos..deptps WHERE 1=2
SELECT * INTO com_vendorprice FROM sypos..vendorprice WHERE 1=2
SELECT * INTO com_custprice FROM sypos..custprice WHERE 1=2
SELECT * INTO com_grouprights FROM sypos..grouprights WHERE 1=2
SELECT * INTO com_import FROM sypos2000..import WHERE 1=2
SELECT * INTO com_alloc FROM sypos2000..alloc WHERE 1=2
SELECT * INTO com_sale FROM sypos2000..sale WHERE 1=2
SELECT * INTO com_adjust FROM sypos2000..adjust WHERE 1=2
SELECT * INTO com_req FROM sypos2000..req WHERE 1=2
SELECT * INTO com_orders FROM sypos2000..orders WHERE 1=2
SELECT * INTO com_importdetail FROM sypos2000..importdetail WHERE 1=2
SELECT * INTO com_allocdetail FROM sypos2000..allocdetail WHERE 1=2
SELECT * INTO com_saledetail FROM sypos2000..saledetail WHERE 1=2
SELECT * INTO com_adjustdetail FROM sypos2000..adjustdetail WHERE 1=2
SELECT * INTO com_orderdetail FROM sypos2000..orderdetail WHERE 1=2
SELECT * INTO com_deptretail FROM sypos2000..deptretail WHERE 1=2
--SELECT * INTO com_cardconsume FROM sypos2000..cardconsume WHERE 1=2
SELECT * INTO com_loss FROM sypos2000..loss WHERE 1=2
SELECT * INTO com_lossdetail FROM sypos2000..lossdetail WHERE 1=2
SELECT * INTO com_deptstock FROM sypos2000..deptstock WHERE 1=2
SELECT * INTO com_dayreport FROM sypos2000..dayreport WHERE 1=2
--SELECT * INTO com_cardflow FROM sypos2000..cardflow WHERE 1=2
SELECT * INTO com_depttablerights FROM sypos..depttablerights WHERE 1=2
SELECT * INTO com_subimport FROM sypos2000..subimport WHERE 1=2
SELECT * INTO com_subimportdetail FROM sypos2000..subimportdetail WHERE 1=2
SELECT * INTO nosubimportdetail FROM sypos2000..subimportdetail WHERE 1=2
/* create view to combine alloc and allocdetail */
select a.*,
InputDate,AllocDate,AuditDate,ReceiptNo,Operator,Employee,DestDept,SrcDept,InputDept,Cost,
TNTaxAmt=b.NTaxAmt,TAmt=b.Amt,AuditFlag,AuditOperator,ReceiveDate,BusinessFlag,ReceiptFlag,Remark
into alloc_all
from allocdetail a,alloc b
where 1=2
SELECT * INTO com_alloc_all FROM alloc_all WHERE 1=2
go
if (select count(*) from sysobjects where name='SendUpTables')>0
DROP VIEW SendUpTables
if (select count(*) from sysobjects where name='SendDownTables')>0
DROP VIEW SendDownTables
if (select count(*) from sysobjects where name='RcvUpTables')>0
DROP VIEW RcvUpTables
if (select count(*) from sysobjects where name='RcvDownTables')>0
DROP VIEW RcvDownTables
if (select count(*) from sysobjects where name='tmp_sndlog')>0
DROP VIEW tmp_sndlog
if (select count(*) from sysobjects where name='sndlog')>0
DROP VIEW sndlog
if (select count(*) from sysobjects where name='rcvoneerror')>0
DROP VIEW rcvoneerror
if (select count(*) from sysobjects where name='rcvlog')>0
DROP VIEW rcvlog
if (select count(*) from sysobjects where name='rcverrcode')>0
DROP VIEW rcverrcode
go
CREATE VIEW tmp_sndlog AS SELECT * FROM sypos..tmp_sndlog
go
CREATE VIEW sndlog AS SELECT * FROM sypos..sndlog
go
CREATE VIEW RcvUpTables AS SELECT * FROM sypos..RcvUpTables
go
CREATE VIEW RcvDownTables AS SELECT * FROM sypos..RcvDownTables
go
CREATE VIEW SendUpTables AS SELECT * FROM sypos..SendUpTables
go
CREATE VIEW SendDownTables AS SELECT * FROM sypos..SendDownTables
go
CREATE VIEW rcvoneerror AS SELECT * FROM sypos..rcvoneerror
go
CREATE VIEW rcvlog AS SELECT * FROM sypos..rcvlog
go
CREATE VIEW rcverrcode AS SELECT * FROM sypos..rcverrcode
go
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -