讓mssql table的自動編號重新從0開始

Posted by on | | 0 意見
DBCC CHECKIDENT('dbo.table_name', RESEED, 0)

使用mssql 讀取excel

Posted by on | | 0 意見
可以直接下sql語法讀取excel
SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\excelfile.xls;Extended Properties=Excel 8.0')...[sheetname$]

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\excelfile.xls', [sheetname$])

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\excelfile.xls', 'SELECT * FROM [sheetname$]')


若出現底下錯誤訊息:
SQL Server 已封鎖元件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 之存取,因為此元件已經由此伺服器的安全性組態關閉。系統管理員可以使用 sp_configure 來啟用 'Ad Hoc Distributed Queries' 的使用。如需有關啟用 'Ad Hoc Distributed Queries' 的詳細資訊,請參閱《SQL Server 線上叢書》中的<介面區組態>(Surface Area Configuration)。

解決辦法:
使用前: (開啟Ad Hoc Distributed Queries)
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

使用後: (關閉Ad Hoc Distributed Queries)
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure

VirtualBox黑蘋果之螢幕大小設定

Posted by on | | 0 意見
方法二的成功了...

while booting at the EFI boot loader screen, type;
“Graphics Mode”=”1280x800x32” and press Enter.

參考:
http://www.sysprobs.com/increase-mac-os-virtual-machine-screen-resolution-virtualbox-vmware-player

Virtualbox - 縮放虛擬硬碟空間

Posted by on | | 0 意見
縮放虛擬硬碟空間
擴大是比較單純的,可直接使用指令設定,但擴大後必需到guest系統中將磁碟的partition擴大才能使用擴大大空間
VBoxManage modifyhd winxppurl --resize 50000 <== 將winxppurl空間擴大到50GB
VBoxManage modifyhd d:\vbx\winxppurl.vdi --resize 50000 <== 將winxppurl空間擴大到50GB

縮小空間,只能針對guest系統中剩下的空間做壓縮
VBoxManage modifyhd winxppurl --compact 壓縮winxppurl空間
VBoxManage modifyhd d:\vbx\winxppurl.vdi --compact