SQL SERVER ºÍEXCELµÄÊý¾Ýµ¼Èëµ¼³ö
SQL SERVER ºÍEXCELµÄÊý¾Ýµ¼Èëµ¼³ö
1¡¢ÔÚSQL SERVERÀï²éѯExcelÊý¾Ý:
-- ======================================================
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
ÏÂÃæÊǸö²éѯµÄʾÀý£¬Ëüͨ¹ýÓÃÓÚ Jet µÄ OLE DB Ìṩ³ÌÐò²éѯ Excel µç×Ó±í¸ñ¡£
SELECT *
from OpenDataSource ( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
-------------------------------------------------------------------------------------------------
2¡¢½«ExcelµÄÊý¾Ýµ¼ÈëSQL server :
-- ======================================================
SELECT * into newtable
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
ʵÀý:
SELECT * into newtable
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
-------------------------------------------------------------------------------------------------
3¡¢½«SQL SERVERÖвéѯµ½µÄÊý¾Ýµ¼³ÉÒ»¸öExcelÎļþ
-- ======================================================
T-SQL´úÂ룺
EXEC master..xp_cmdshell 'bcp ¿âÃû.dbo.±íÃûout c:\Temp.xls -c -q -S"servername" -U"sa" -P""'
²ÎÊý£ºS ÊÇSQL·þÎñÆ÷Ãû£»UÊÇÓû§£»PÊÇÃÜÂë
˵Ã÷£º»¹¿ÉÒÔµ¼³öÎı¾ÎļþµÈ¶àÖÖ¸ñʽ
ʵÀý:EXEC master..xp_cmdshell 'bcp saletesttmp.dbo.CusAccount out c:\temp1.xls -c -q -S"pmserver" -U"sa" -P"sa"'
EXEC master..xp_cmdshell 'bcp "SELECT au_fname, au_lname from pubs..authors ORDER BY au_lname" queryout C:\ authors.xls -c -Sservername -Usa -Ppassword'
ÔÚVB6ÖÐÓ¦ÓÃADOµ¼³öEXCELÎļþ´úÂ룺
Dim cn As New ADODB.Connection
cn.open "Driver={SQL Server};Server=WEBSVR;DataBase=WebMis;UID=sa;WD=123;"
cn.execute "master..xp_cmdshell 'bcp "SELECT col1, col2 from ¿âÃû.dbo.±íÃû" queryout E:\DT.
Ïà¹ØÎĵµ£º
Sql Server ÖÐÒ»¸ö·Ç³£Ç¿´óµÄÈÕÆÚ¸ñʽ»¯º¯Êý
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVE ......
SQL Server CE 2.0µÄÈ«ÃûÊÇSQL Server 2000 Windows CE Edition version 2.0¡£
Àý×Ó1£º¹«Ë¾ÅÉÈËÈ¥²Ö¿âÑé»õ¡¢µã»õ£¬¿ÉÒÔ°ÑÇ嵥ͬ²½µ½Pocket PCÉÏ£¬È»ºóÔÚ²Ö¿âÀïÃæÖ±½ÓÔÚPPCÉÏÃæupdate£¬»Øµ½¹«Ë¾Ò»Í¬²½¾Í¿ÉÒÔÁË¡£·ñÔò°´ÕÕÔÏÈ×ö·¨£¬ÐèÒªÏÈ´òÓ¡Ò»ÕÅÇåµ¥£¬»ØÀ´ÒÔºóÔÙ¼ÈëÒ»±é¡£
Àý×Ó2£ºÁªÏëÅÉÈËÉÏÃÅÀ´ÐÞµçÄÔ£¬ÒÔÇ°×ÜÊÇ´ ......
ÅäÖÃʹÓà SQL ServerÌṩ³ÌÐò
<configuration>
<system.web> <-- ¸ü¸ÄÌṩ³ÌÐòÅäÖ㺠-->
<membership defaultProvider="AspNetSqlProvider" />
</system.web>
<membership> <--ÅäÖÃÌṩ³ÌÐò -->
<prov ......
ÔÚPostgreSQL8.1.3ÉÏ¿ÉÒÔwork
1. È¡Êý¾Ý¿â´óС
SELECT pg_size_pretty(pg_database_size('somedatabase')) As fulldbsize
2. È¡±í´óС
SELECT pg_size_pretty(pg_total_relation_size('someschema.sometable')) As fulltblsize, pg_size_pretty(pg_relation_size('someschema.sometable')) As justthetblsize
ÔÌù£º
......