-------------------------------------------------- 以下是重启

shutdown -r -t 50 -f 

--------------------------------------------------以下是远程备份

@echo off 操作执行中
@echo off
net use z: \\192.168.0.48\software\testData2014 "123456" /USER:administrator
set wd=%date:~0,4%%date:~5,2%%date:~8,2%
set str=erpdb1%wd%0800.bak
set strdy=dydb_n%wd%0800.bak
set filedy=i:\dydb_n\%strdy%

set strwj=wjdb1%wd%0800.bak
set filewj=i:\wjdb1\%strwj%

set strfz=fzdb_n%wd%0800.bak
set filefz=i:\fzdb_n\%strfz%

set strjob=Jobdb5%wd%0800.bak
set filejob=i:\Jobdb5\%strjob%   

del z:\*.bak  
@echo on

echo --------  执行时间: %date% %time% --------     >> z:\log.txt
echo 复制文件开始 >> z:\log.txt
copy I:\erpdb1\%str%  z:\erpdb1.bak       >> z:\log.txt
copy  %filedy% z:\dydb_n.bak       >> z:\log.txt
copy  %filewj% z:\wjdb1.bak        >> z:\log.txt
copy  %filefz% z:\fzdb_n.bak       >> z:\log.txt
copy  %filejob% z:\Jobdb5.bak      >> z:\log.txt
echo 复制文件结束 >> z:\log.txt
echo       ---- %time%    >> z:\log.txt

--------------------------------------以下是远程网络连接

@echo off 操作执行中
@echo off
net use z: \\192.168.0.48\software\testData2014 "123456" /USER:administrator
pause

----------------------------------以下是常用SQL语句

select a.ywdate 业务日期,u.Name,a.docno 订单,s.scdh 子单号,cpid 产品编号,cpname 产品名称,sl 数量,a.bz 币种, a.hl 汇率,s_price 金额
from sale_head a,sale_detail s ,users u where
a.docno = s.docno and a.yw = u.Login and
a.ywdate between CONVERT(datetime,'2015-07-01 00:00:01',101)   and  CONVERT(datetime,'2015-09-30 23:00:01',101) 
 order by a.ywdate ,a.docno
 
select * from sale_detail where docno = '201510B010'


insert into tc_tab1 (yf,qtcbe,cgtc, jge,[docno],[allxse],[dke],[chcbe],[chxse],[yzfe],[yfsre],syw,tc)
select '2015-08',0,0,0,v.docno,[allxse],[dke],[chcbe],[chxse],[yzfe],[yfsre],h.yw,u.fc
from dbo.V_ywyfc_now v,sale_head h,users u  where  v.docno = h.docno and h.yw = u.Login and   v.docno = '201507A042'
---2015-9-14  以上是8月第一单

insert into tc_tab1 (yf,qtcbe,cgtc, jge,[docno],[allxse],[dke],[chcbe],[chxse],[yzfe],[yfsre],syw,tc)
select '2015-08',0,0,0,v.docno,[allxse],[dke],[chcbe],[chxse],[yzfe],[yfsre],h.yw,u.fc
from dbo.V_ywyfc_now v,sale_head h,users u  where  v.docno = h.docno and h.yw = u.Login and   v.docno = '201508A012'