SQL¶ÁÈ¡EXCEL
Ö±½ÓÔÚSQL²éѯ·ÖÎöÆ÷ÖжÁÈ¡EXCELÎļþÐèҪʹÓõ½OPENDATASOURCE¡£
µ«ÊÇʹÓÃËü֮ǰÐèÒª½øÐÐÅäÖÃһϡ£¼ÇµÃÈçÏÂÅäÖÃÊDZØÐëµÄ£º
1¡¢Ö´ÐÐÕâÁ½¸ö´æ´¢¹ý³Ì£º
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
ËüµÄ×÷Óãº
µÚÒ»¸öÊÇ£ºÊÇ·ñÖ§³Ö¸ß¼¶Ñ¡ÏîµÄ£¬1Ϊ֧³Ö0Ϊ²»Ö§³Ö¡£
µÚ¶þ¸öÊÇ£ºÊÇ·ñÖ§³Ö·Ö²¼Ê½²éѯ£¬
1Ϊ֧³Ö0Ϊ²»Ö§³Ö¡£
¶øÇÒÒ»¶¨ÊÇÏÈÖ§³Ö¸ß¼¶Ñ¡ÏÔÙ¿ÉÒÔÉèÖ÷ֲ¼Ê½²éѯ£¬ÒòΪ·Ö²¼Ê½²éѯ±¾Éí¾ÍÊÇ
Ò»¸ö¸ß¼¶Ñ¡ÏîÀ´µÄ¡£
2¡¢Ê¹ÓÃOPENDATASOURCE£¬ËüÓÐÁ½ÖÖÓï·¨
£¨1£©SELECT * from OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=D:\TempExcelData\Exl_Test_01.xls;Extended Properties=EXCEL 5.0')...[Student$]
£¨2£©select *
from Openrowset('Microsoft.Jet.OLEDB.4.0','EXCEL 8.0;HDR=YES;User id=admin;Password=;IMEX=1;
DATABASE=D:\TempExcelData\Exl_Test_01.xls', Student$)
3¡¢ÓÃÍêºóÒª¹Ø±ÕµÚÒ»²½´ò¿ªµÄ¶«Î÷
exec sp_configure 'show advanced options',0
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
°´Õմ˲½²»Ò»¶¨¿ÉÒÔ²éѯµ½ÄãEXCELµÄÊý¾Ý£¬¿ÉÄÜ»¹»áÓÐÆäËüµÄ´íÎ󣬱ÈÈç˵ȨÏÞ
²»×ã¹»Òý·¢ÆäËüµÄÎÊÌâ°¡£¬ÒªÔÚÍøÉÏÕÒ¶àһϣ¬¾ÍÈçÎÒÅäÖõÄʱºò£¬ÓõÄÊÇSA½øÈ¥µÄ£¬
µ«ÊÇSA²»ÊÇSYSADMINISTRATORÕâÒ»×飬Ҫ¼Ó½øÈ¥ºó²ÅÓÐȨÏÞ£¬²ÅÄÜ˳Àû²éµ½Êý¾Ý
Ïà¹ØÎĵµ£º
ÔÚ³ÌÐòÖУ¬Êý¾Ý¿â²Ù×÷ÊDZز»¿ÉÉٵIJ¿·Ö£¬ËùÒÔÎÒÃÇÒª±¸×ãÊý¾Ý¿âÏà¹ØÖªÊ¶²ÅÄÜÈ¥Ó¦¸¶³ÌÐòÖгöÏÖµÄÖÖÖÖÎÊÌâ¡£»ùÓÚ´Ë£¬ÎÒÌØµØÔÚ¹úÍâÍøÕ¾¡¢²©¿ÍÉÏÕûÀíÁËһЩÎÊÌ⣬²¢¸½´øÁ˴𰸺ͽâÊÍ¡¢²Î¿¼¡£ÎªÁ˱£Ö¤“ÔÖÔ攣¬ÎҾͱ£ÁôÁËÓ¢ÎÄ¡£´ó¼ÒÒ²À´¿´¿´Äã´ð¶ÔÁ˶àÉÙ£¿
1.SQL Server 2008 Backup
ÌâÄ¿£ºIs it possible to re ......
SQLÓï¾äÓÅ»¯¼¼Êõ·ÖÎö
²Ù×÷·ûÓÅ»¯
IN ²Ù×÷·û
ÓÃINд³öÀ´µÄSQLµÄÓŵãÊDZȽÏÈÝÒ×д¼°ÇåÎúÒ×¶®£¬Õâ±È½ÏÊʺÏÏÖ´úÈí¼þ¿ª·¢µÄ·ç¸ñ¡£
µ«ÊÇÓÃINµÄSQLÐÔÄÜ×ÜÊDZȽϵ͵쬴ÓORACLEÖ´ÐеIJ½ÖèÀ´·ÖÎöÓÃINµÄSQLÓë²»ÓÃINµÄSQLÓÐÒÔÏÂÇø±ð£º
¡¡¡¡¡¡ORACLEÊÔͼ½«Æäת»»³É¶à¸ö±íµÄÁ¬½Ó£¬Èç¹ûת»»²»³É¹¦ÔòÏÈÖ´ÐÐINÀïÃæµÄ×Ó²éѯ£¬ ......
Transact SQL Óï ¾ä ¹¦ ÄÜ
========================================================================
¡¡¡¡--Êý¾Ý²Ù×÷
¡¡¡¡ SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
¡¡¡¡¡¡¡¡¡¡¡¡INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
¡¡¡¡¡¡¡¡¡¡¡¡DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
¡¡¡¡¡¡¡¡¡¡¡¡UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý ......
use master
go
if exists(select * from dbo.sysobjects where id = object_id(N'[dbo].[P_KillConnections]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[P_KillConnections]
GO
create proc P_KillConnections
@dbname varchar(200)
as
declare @sql nvarchar(500)
declare @spid nvar ......
ÏÂͼÏÔʾÁËÊý¾Ý¿â±¸·ÝʱÎļþ¶ÁдµÄ¹ý³Ì£º
ÔÚ±¸·ÝÆÚ¼ä£¬SQL Server»áÔÚÊý¾Ý¿âÎļþÕâ±ßΪÿһÅÌ·û(Volume)´´½¨Ò»¸ö¶ÁÏ̡߳£¶ÁÏ̵߳Ť×÷ºÜ¼òµ¥£¬¾ÍÊÇ´ÓÎļþÖеÄÊý¾ÝÄÚÈÝ¡£Ã¿´ÎÕâ¸öÏ̶߳¼»á´ÓÎļþÖжÁ³ö²¿·ÖÊý¾Ý£¬È»ºó°ÑÊý¾Ý´æµ½»º³åÖÐ(buffer)¡£ÒòΪÓжà¸ö»º³å¿ÉÓã¬ËùÒÔÖ»ÒªÓлº³å¿ÉÒÔдÈëÊý¾Ý£¬¶ÁÏ߳̿ÉÒÔ²»Í£µÄ¶ÁÊý¾Ý¡ ......