sqlserver2005Ô¶³ÌÁ¬½Ó mysql
sqlserver2005Ô¶³ÌÁ¬½Ó mysql
2ÖÖ·½·¨
Ò»ÊÇͨ¹ý½¨Á¢linkµÄ·½·¨
sp_addlinkedserver 'ntest-linkÃû', 'MySQL', 'MSDASQL--Ö§³ÖµÄÁ´½Ó·½Ê½', 'mytest-dsnÃû'
GO
sp_addlinkedsrvlogin 'ntest-linkÃû','false', 'sa-sqlserverÓû§','mythzz-sqlserverÃÜÂë'
¾ßÌå¿ÉÒԲο¼ °ïÖúÎĵµ
select * from ntest..pdns.tt
µ«ÊÇÎÒʽÁË Ìáʾ¾Ü¾øÓû§ÐèÒªÃÜÂë
Driver]Access denied for user
µÈ¿ÕÁËÔÚ¸ãÏÂ
µÚ¶þÖÖ·½·¨ÊÇÖ±½ÓÓÃ
OPENROWSETÓëOPENQUERY£¨¾ßÌå¿ÉÒÔ²ésql°ïÖúÎĵµ£©
¿ªÆôÊý¾Ý¿âÑ¡Ïî
SP_CONFIGURE 'show advanced options',1
GO
RECONFIGURE
GO
-- Ϊ¿ªÆôΪ¹Ø±Õ
SP_CONFIGURE 'Ad Hoc Distributed Queries',1
GO
RECONFIGURE
GO
SP_CONFIGURE 'show advanced options',0
GO
RECONFIGURE
SELECT *
from OPENROWSET('MSDASQL','mytest';'root';'mythzz',
'SELECT * from pdns.tt')
Ïà¹ØÎĵµ£º
1.oracle»·¾³
create table test
(
id number(4),
name varchar2(20)
)
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯû±»×èÈû
2.sqlserver»·¾³
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯ±»×èÈû(Ê ......
1.°²×°ºÃSQLServer 2005Êý¾Ý¿âÈí¼þ£¬½Ó×Å×îÖØÒªµÄ¾ÍÊÇ°²×°Êý¾Ý¿âÇý¶¯SQL Server 2005 driver for JDBC£¬¿ÉÒÔµ½:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exeÏÂÔØ
2.½«JDBC½âѹµ½ÈÎÒâµÄλÖã¬ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ½²¹ý» ......
select a.UserName Óû§Ãû,b.LoginName ºÅÂë,c.MenuTitle ±êÌâ,max(a.AccessTime)·ÃÎÊʱ¼ä from JfAccessLog a,OaUser b,JfMenu c where CONVERT(char,a.AccessTime,112)=CONVERT(char,GETDATE(),112) and a.UserId=b.UserId and a.MenuId=c.MenuId and a.MenuId=@menu group by a.UserName,b.LoginName,c.Menu ......
eg:
select * from Exception_Log where DATEDIFF(day,OPER_DATE,getdate())<30 ;
/*
oper_date Ϊ±íÖвéѯ³öÀ´µÄʱ¼ä
getdate()ΪSQLServerÀïÃæ»ñµÃϵͳʱ¼äµÄº¯Êý
º¬Ò壺µ±Ç°Ê±¼ä-²éѯ³öÀ´µÄʱ¼äСÓÚ30Ìì
DateDiff¾ßÌåÓ÷¨£º
*/
DateDiff º¯Êý
·µ»ØÁ½¸öÈÕÆÚÖ®¼äµÄʱ¼ä¼ä¸ô¡£
DateDiff(interval, date1, da ......
¼Ç¼һÏÂÒÔ±¸Ï´οìËÙÕÒµ½¡£¡£¡£
Íùtb_wf_privgrant±íÖвåÈëÒ»Ìõ¼Ç¼£¬workflow_id×Ö¶ÎÖµ´Ótb_wf_workflow ±íÖлñÈ¡workflow_name='֪ʶÉóºË'µÄËùÓмǼÖÐworkflow_id×î´óÖµ¡£
--oracle
declare a NUMBER(10);
begin
select max(wo ......