SQL Server½Ì³Ì:¶ÁÈ¡µÚÈý·½Êý¾Ý¿âµÄÊý¾Ý
×÷Õß: cnd8, ¡¡³ö´¦:ITר¼ÒÍøÂÛ̳,¡¡ÔðÈαà¼: ³Â×Óç÷,¡¡2010-04-21 13:00 ¡¡¡¡ÏÖÔÚÐèÒªÔÚһ̨·þÎñÆ÷(A)ÉϵÄÊý¾Ý¿â(Master)Àï·ÃÎÊÁíÍâһ̨·þÎñÆ÷(B)µÄÁíÍâÁ½¸öÊý¾Ý¿â(NZ ºÍ AU)¡£AU ºÍ NZ ÊÇÍøÕ¾µÄ²¿·ÖʵʱÊý¾Ý£¬Ä¿Ç°Ä³Ò»²½²Ù×÷µÄREPLICATION·½°¸ÊÇ´Ó·þÎñÆ÷Bµ½A£¬AU / NZ µÄ±í½á¹¹Í¬Master Êý¾Ý½á¹¹»ù±¾Ò»Ö¡£¡¡¡¡ÏÖÔÚÐèÒªÔÚһ̨·þÎñÆ÷(A)ÉϵÄÊý¾Ý¿â(Master)Àï·ÃÎÊÁíÍâһ̨·þÎñÆ÷(B)µÄÁíÍâÁ½¸öÊý¾Ý¿â(NZ ºÍ AU)¡£AU ºÍ NZ ÊÇÍøÕ¾µÄ²¿·ÖʵʱÊý¾Ý£¬Ä¿Ç°Ä³Ò»²½²Ù×÷µÄREPLICATION·½°¸ÊÇ´Ó·þÎñÆ÷Bµ½A£¬AU / NZ µÄ±í½á¹¹Í¬Master Êý¾Ý½á¹¹»ù±¾Ò»Ö¡£ ¡¡¡¡ÕâÑùÒ»À´£¬µ±°ÑAU Replication µ½ Master ºó£¬ÔÚ°Ñ NZ Replication µ½ Master , Master ÀïµÄ¾Íֻʣ NZ µÄÊý¾ÝÁË¡£·´¹ýÀ´¾ÍÖ»ÓÐAUµÄÁË£¬¾ßÌåµÄReplication ÊÇÔõôһ»ØÊ£¬ÎÒÒ²²»¶®£¬Ò²Ã»ÓÐϸ¿´¡£ ¡¡¡¡Èç¹ûÄÜÔÚMaster ÀïÖ±½Ó²Ù×÷ AU ºÍ NZ ¾ÍºÃÁË¡£ ¡¡¡¡SQLServer Óк¯Êý£º ¡¡¡¡OPENROWSET ºÍ OPENDATASOURCE ¡¡¡¡ÕâÁ½¸öº¯Êý²»µ«ÄÜʵÏÖ´ÓÁíÍâµÄÊý¾Ý¿â¶ÁÊý¾Ý£¬¶øÇÒ»¹ÄÜ´ÓEXCEL¡¢TXT£¬ ORACLE£¬ ODBC µÈ¶ÁÊý¾Ý¡£ ¡¡¡¡--ÆôÓÃAd Hoc Distributed Queries£º ¡¡¡¡exec sp_configure 'show advanced options',1 ¡¡¡¡reconfigure ¡¡¡¡exec sp_configure 'Ad Hoc Distributed Queries',1 ¡¡¡¡reconfigure ¡¡¡¡SELECT * ¡¡¡¡from OPENDATASOURCE( ¡¡¡¡'SQLOLEDB', ¡¡¡¡'Data Source=SQLServerName;User ID=sa;Password=xxx' ¡¡¡¡).Help.dbo.Help_Category ¡¡¡¡»ò ¡¡¡¡select * from openrowset( 'SQLOLEDB ', 'SQLServerName'; 'sa'; 'xxx', Help.dbo.Help_Category ) ¡¡¡¡--¹Ø±ÕAd Hoc Distributed Queries£º ¡¡¡¡exec sp_configure 'Ad Hoc Distributed Queries',0 ¡¡¡¡reconfigure ¡¡¡¡exec sp_configure 'show advanced options',0 ¡¡¡¡reconfigure ¡¡¡¡µ«ÊÇ£¬ÕâÑùд×ÅÓе㸴ÔÓ£¬¶øÇÒ²»±ãÓÚά»¤£¬¼ÙÈçÊý¾Ý¿âÃÜÂë¸Ä±äÁË£¬¾ÍÐèÒª°ÑÒ»¸öÒ»¸ö°ÑÃÜÂë¸ÄÕý¡£ ¡¡¡¡Oracle ÀïÓÐ DB Link, ¶øÇÒÓï·¨·Ç³£¼ò½à¡£ ¡¡¡¡²éÁËһϰïÖú£¬SQLServer ÀïÓÐ "Á´½Ó·þÎñÆ÷" Õâ¸ö¶«¶«¡£Òª´´½¨ Á´½Ó·þÎñÆ÷ÐèÒªÓõ½SQLServer µÄÒ»¸öϵͳ´æ´¢¹ý³Ì£º ¡¡¡¡sp_addlinkedserver [ @server= ] 'server' [ , [ @srvproduct= ] 'product_name' ] ¡¡¡¡[ , [ @provider= ] 'provider_name' ] ¡¡¡¡[ , [ @datasrc= ] 'data_source' ] ¡¡¡¡[ , [ @location= ] 'location' ] ¡¡¡¡[ , [ @provstr= ] 'provider_string' ] ¡¡¡¡[ , [ @catalog= ] 'catalog' ]
Ïà¹ØÎĵµ£º
OUTPUT×Ó¾äÊÇSQL Server 2005 ÖжÔINSERT¡¢UPDATEºÍDELETEÐÂÔöµÄ£¬½ñÌì¿´¼ûÔ°×ÓÀïÓÐÈËÌáÆð(SQL2005Öзµ»ØÐ޸ĺóµÄÊý¾Ý)£¬¾ÍÔÚÕâÀï¼Ç¼һÏÂËüµÄÓï·¨¡£
OUTPUT { DELETED | INSERTED | from_table_name }. {* | column_name } [,...n]
&nbs ......
ÒÔÏÂÊǵÚһƪ£º
/*--±È½ÏÁ½¸öÊý¾Ý¿âµÄ±í½á¹¹²îÒì
--*/
/*--µ÷ÓÃʾÀý
exec p_comparestructure 'xzkh_model','xzkh_new'
--*/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_comparestructure]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_comparestructure ......
SQL SERVER ºÍEXCELµÄÊý¾Ýµ¼Èëµ¼³ö
ͨ³£µÄ·½·¨ÊÇʹÓÃͼÐνçÃæµÄdts¹¤¾ß£¬µ«·¢¾õÓÐЩʹÓÃÃüÁîÐнçÃæµÄ·½Ê½¸ü¼òµ¥
1¡¢ÔÚSQL SERVERÀï²éѯExcelÊý¾Ý:
-- ======================================================
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";Use ......
×î½üÁ½ÌìÒ»Ö±ÔÚÕÛÌÚSQLÓï¾ä£¬Ã»°ì·¨£¬Ð´Êý¾Ý¿âµÄÐֵܸøÁËÁ½¸öÀý×ӾͲ»ÔÙ¹ÜÁË£¬¶øÇÒ×î½üÇë¼ÙÁË¡£½ñÌì¼Ó°à»¹ÊÇÕÛÌÚÕâôһ¸öÓï¾ä£¬×ÜÊDz»¶Ô£¬ÇëÀÏ´ó¿´ÁË¿´»¹ÊÇû¿´³öÃŵÀÀ´£¬ ÔÚSQLite Expert Professional ÀïÃæдµÄÓï¾ä¶¼¿ÉÒÔÖ´Ðгɹ¦£¬µ«ÊÇÔÚAndroidµÄ¹¤³ÌÀïÃæÔõôÕÛÌھͲ»¶Ô¡£ ÓôÃÆ°¡£¬½ñÌì¼Ó°àËãÊÇ°×¼ÓÁË¡£
ΪÁ˲éÕÒºÍÑ§Ï ......
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'CLR', 0
GO
-- To update the currently configured value for this feature.
......