ÔÚSQLÖÐÏò¶à¸öÊý¾Ý¿âÖвåÈëÏàͬµÄ¼Ç¼
½ñÌìÒ»¸öÅóÓÑÎʵ½Õâ¸öÎÊÌ⣬ÆäʵºÜºÃ½â¾ö£º
declare @dbname varchar(50)
declare c_database cursor for
select name from master.dbo.sysdatabases where name like '%Êý¾Ý¿âÃû%'
open c_database
fetch next from c_database into @dbname
while @@fetch_status=0
begin
exec('use '+@dbname
+' insert into ±íÃû(×Ö¶Î) values(''ÄÚÈÝ'')')
fetch next from c_database into @dbname
end
close c_database
deallocate c_database
go
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Ò»¡¢±³¾°½éÉÜ
¡¡¡¡
¡¡¡¡½á¹¹»¯²éѯÓïÑÔ(Structured Query Language£¬¼ò³ÆSQL)ÊÇÓÃÀ´·ÃÎʹØÏµÐÍÊý¾Ý¿âÒ»ÖÖͨÓÃÓïÑÔ£¬ÊôÓÚµÚËÄ´úÓïÑÔ£¨4GL£©£¬ÆäÖ´ÐÐÌØµãÊǷǹý³Ì»¯£¬¼´²»ÓÃÖ¸Ã÷Ö´ÐеľßÌå·½·¨ºÍ;¾¶£¬¶øÊǼòµ¥µØµ÷ÓÃÏàÓ¦Óï¾äÀ´Ö±½ÓÈ¡µÃ½á¹û¼´¿É¡£ÏÔÈ»£¬ÕâÖÖ²»¹Ø×¢ÈκÎʵÏÖϸ½ÚµÄÓïÑÔ¶ÔÓÚ¿ª·¢ÕßÀ´ËµÓÐ׿«´óµÄ±ãÀû¡£È»¶ø£¬Ó ......
ÔÎĵØÖ·£ºhttp://www.blogjava.net/xingcyx/archive/2007/01/09/92638.html
ʹÓÃoracleµÄ10046ʼþ¸ú×ÙSQLÓï¾ä
ÎÒÃÇÔÚ·ÖÎöÓ¦ÓóÌÐòÐÔÄÜÎÊÌâµÄʱºò£¬¸ü¶àµØÐèÒª¹Ø×¢ÆäÖÐSQLÓï¾äµÄÖ´ÐÐÇé¿ö£¬ÒòΪͨ³£Ó¦ÓóÌÐòµÄÐÔÄÜÆ¿¾±»áÔÚÊý¾Ý¿âÕâ±ß£¬Òò´ËÊý¾Ý¿âµÄsqlÓï¾äÊÇÎÒÃÇÓÅ»¯µÄÖØµã¡£ÀûÓÃOracleµÄ10046ʼþ£¬¿ÉÒÔ¸ú×ÙÓ¦ÓóÌÐòËùÖ´ ......
ÓÐÐí¶à²»Í¬ÀàÐ͵ÄÊý¾Ý¿â¹ÜÀíÔ±¡£ һЩÀàÐ͵ÄÊý¾Ý¿â¹ÜÀíÔ±ÖÂÁ¦ÓÚÓÚ¿ª·¢ÁìÓò£¬¶øÆäËûµÄÒ»²¿·Ö¸üÖØÊÓÊý¾Ý¿âÐÔÄܵĵ÷ÕûÒÔ¼°ÈÔÈ»ÓÐÒ»²¿·ÖÊý¾Ý¿â¹ÜÀíÔ±ÔòÖÂÁ¦ÓÚ¹ÜÀíSQL ServerµÄÒµÎñ¡£ ÒÀ¾ÝÊý¾Ý¿â¹ÜÀíÔ±µÄ¹¤×÷»·¾³²»Í¬£¬ËûÃǽ«Ö´ÐÐÒ»¶¨ÊýÁ¿µÄ²»Í¬µÄÈÎÎñ¡£ÎªÁËÇø·ÖËùÓв»Í¬µÄÈÎÎñ£¬Êý¾Ý¿â¹ÜÀíÔ±¿ÉÄÜÒªÖ´ÐÐÎÒÇåµ¥ÉÏËùÁеÄÈÎÎñ¡£
¡¡ ......
ÔÚÎÒÃÇÈÕ³£Ê¹ÓÃSQL ServerÊý¾Ý¿âʱ£¬¾³£Óöµ½ÐèÒªÔÚʵÀýInstance01ÖпçʵÀý·ÃÎÊInstance02ÖеÄÊý¾Ý¡£ÀýÈçÔÚ×öÊý¾ÝÇ¨ÒÆÊ±£¬ÈçÏÂÓï¾ä:
insert into Instance01.DB01.dbo.Table01
select * from Instance02.DB01.dbo.Table01
ÆÕͨÇé¿öÏ£¬ÕâÑù×öÊDz»ÔÊÐíµÄ£¬ÒòΪSQ ......