2013年7月15日 星期一
mssql 刪除欄位
/*20130716 delete field*/
IF (select count(name) from syscolumns where id=(select id from sysobjects where name='book') and name='emp_id') > 0
BEGIN
ALTER TABLE book DROP emp_id
END
2013年7月11日 星期四
2013年7月2日 星期二
PH值
pH 值之範圍介於 0~14 之間,pH 值為7時表中性,pH 值比 7大為鹼性,比 7小時為酸性;pH 值之單位是用對數表示,即pH相差1其強度就差 10 倍,如 pH 3 就比 pH 4 酸性強了 10 倍。純水的pH值為 7,代表中性。下圖說明 pH 值小於7的液體,也就是酸性溶液: 牛奶略小於7,番茄汁略大於 4,醋約 3,檸檬汁為 2,一般雨水則為5 左右。
win7 防火牆 指令開 port (cmd)
參考引用:
請參考詳細:使用 netsh 設定防火牆
--
如果輸入 command到打
netsh firewall add portopening protocol = TCP port =1433 name = TCP_1433:新增port
範例:
netsh advfirewall firewall add rule name="MSSQL" protocol=TCP dir=out localport=1433 action=allow
netsh advfirewall firewall add rule name="MSSQL" protocol=TCP dir=in localport=1433 action=allow
==
使用方式: add rule name=
dir=in|out
action=allow|block|bypass
[program=]
[service=|any]
[description=]
[enable=yes|no (default=yes)]
[profile=public|private|domain|any[,...]]
[localip=any|||||
[remoteip=any|localsubnet|dns|dhcp|wins|defaultgateway|
||||
[localport=0-65535|[,...]|RPC|RPC-EPMap|IPHTTPS|any (defaul
[remoteport=0-65535|[,...]|any (default=any)]
[protocol=0-255|icmpv4|icmpv6|icmpv4:type,code|icmpv6:type,code|
tcp|udp|any (default=any)]
[interfacetype=wireless|lan|ras|any]
[rmtcomputergrp=]
[rmtusrgrp=]
[edge=yes|deferapp|deferuser|no (default=no)]
[security=authenticate|authenc|authdynenc|authnoencap|notrequired
(default=notrequired)]
備註:
- 將新的輸入規則或輸出規則新增至防火牆原則。
- 規則名稱應該是唯一且不能是 "all"。
- 如果指定了遠端電腦或使用者群組,security 必須是 authenticate、
authenc、authdynenc 或 authnoencap。
- 將安全性設定為 authdynenc 可讓系統為符合指定 Windows 防火牆規則的流
量動態交涉加密的使用。加密是根據現有的連線安全性規則內容來交涉。這個
選項允許電腦能夠接受輸入 IPsec 連線的第一個 TCP 或 UDP 封包,只要它
是安全的,但不會使用 IPsec 來加密。一旦處理第一個封包,伺服器將會重
新交涉連線並升級它,這樣才能完全地加密所有後續的通訊。
- 如果 action=bypass,當 dir=in 時必須指定遠端電腦群組。
- 如果 service=any,此規則僅適用於服務。
- ICMP 類型或代碼可以是 "any"。
- 只有輸入規則才可以指定 Edge。
- AuthEnc 與 authnoencap 不能一起使用。
- 只有當 dir=in 時,Authdynenc 才有效。
- 當設定 authnoencap 時,security=authenticate 選項會變成選擇性參數。
範例:
為 messenger.exe 新增沒有壓縮安全性的輸入規則:
netsh advfirewall firewall add rule name="allow messenger"
dir=in program="c:\programfiles\messenger\msmsgs.exe"
security=authnoencap action=allow
為連接埠 80 新增輸出規則:
netsh advfirewall firewall add rule name="allow80"
protocol=TCP dir=out localport=80 action=block
為 TCP 連接埠 80 流量新增需要安全性與加密的輸入規則:
netsh advfirewall firewall add rule
name="Require Encryption for Inbound TCP/80"
protocol=TCP dir=in localport=80 security=authdynenc
action=allow
為 messenger.exe 新增輸入規則並且需要安全性
netsh advfirewall firewall add rule name="allow messenger"
dir=in program="c:\program files\messenger\msmsgs.exe"
security=authenticate action=allow
為由 SDDL 字串識別的 acmedomain\scanners 群組新增已驗證的防
火牆略過規則:
netsh advfirewall firewall add rule name="allow scanners"
dir=in rmtcomputergrp= action=bypass
security=authenticate
為本機連接埠 5000-5010 新增輸出允許規則以用於 udp-
Add rule name="Allow port range" dir=out protocol=udp localport=5000-
5010 action=allow
請參考詳細:使用 netsh 設定防火牆
--
如果輸入 command到打
netsh firewall add portopening protocol = TCP port =1433 name = TCP_1433:新增port
範例:
netsh advfirewall firewall add rule name="MSSQL" protocol=TCP dir=out localport=1433 action=allow
netsh advfirewall firewall add rule name="MSSQL" protocol=TCP dir=in localport=1433 action=allow
==
使用方式: add rule name=
dir=in|out
action=allow|block|bypass
[program=
[service=
[description=
[enable=yes|no (default=yes)]
[profile=public|private|domain|any[,...]]
[localip=any|
- ]
[remoteip=any|localsubnet|dns|dhcp|wins|defaultgateway|
- ]
[localport=0-65535|
[remoteport=0-65535|
[protocol=0-255|icmpv4|icmpv6|icmpv4:type,code|icmpv6:type,code|
tcp|udp|any (default=any)]
[interfacetype=wireless|lan|ras|any]
[rmtcomputergrp=
[rmtusrgrp=
[edge=yes|deferapp|deferuser|no (default=no)]
[security=authenticate|authenc|authdynenc|authnoencap|notrequired
(default=notrequired)]
備註:
- 將新的輸入規則或輸出規則新增至防火牆原則。
- 規則名稱應該是唯一且不能是 "all"。
- 如果指定了遠端電腦或使用者群組,security 必須是 authenticate、
authenc、authdynenc 或 authnoencap。
- 將安全性設定為 authdynenc 可讓系統為符合指定 Windows 防火牆規則的流
量動態交涉加密的使用。加密是根據現有的連線安全性規則內容來交涉。這個
選項允許電腦能夠接受輸入 IPsec 連線的第一個 TCP 或 UDP 封包,只要它
是安全的,但不會使用 IPsec 來加密。一旦處理第一個封包,伺服器將會重
新交涉連線並升級它,這樣才能完全地加密所有後續的通訊。
- 如果 action=bypass,當 dir=in 時必須指定遠端電腦群組。
- 如果 service=any,此規則僅適用於服務。
- ICMP 類型或代碼可以是 "any"。
- 只有輸入規則才可以指定 Edge。
- AuthEnc 與 authnoencap 不能一起使用。
- 只有當 dir=in 時,Authdynenc 才有效。
- 當設定 authnoencap 時,security=authenticate 選項會變成選擇性參數。
範例:
為 messenger.exe 新增沒有壓縮安全性的輸入規則:
netsh advfirewall firewall add rule name="allow messenger"
dir=in program="c:\programfiles\messenger\msmsgs.exe"
security=authnoencap action=allow
為連接埠 80 新增輸出規則:
netsh advfirewall firewall add rule name="allow80"
protocol=TCP dir=out localport=80 action=block
為 TCP 連接埠 80 流量新增需要安全性與加密的輸入規則:
netsh advfirewall firewall add rule
name="Require Encryption for Inbound TCP/80"
protocol=TCP dir=in localport=80 security=authdynenc
action=allow
為 messenger.exe 新增輸入規則並且需要安全性
netsh advfirewall firewall add rule name="allow messenger"
dir=in program="c:\program files\messenger\msmsgs.exe"
security=authenticate action=allow
為由 SDDL 字串識別的 acmedomain\scanners 群組新增已驗證的防
火牆略過規則:
netsh advfirewall firewall add rule name="allow scanners"
dir=in rmtcomputergrp=
security=authenticate
為本機連接埠 5000-5010 新增輸出允許規則以用於 udp-
Add rule name="Allow port range" dir=out protocol=udp localport=5000-
5010 action=allow
2013年7月1日 星期一
售價折讓平均分攤到每一筆
售價折讓平均分攤到每一筆
若本次交易3個品項
1.100
2.200
3.300
共折讓:60
則每一筆平均分攤金額為:
100+200+300=600
1.(100/600)*60=9.6 =>10
2.(200/600)*60=19.8 =>20
3.(300/600)*60=30 =>30
訂閱:
文章 (Atom)