EXEC sp_addlinkedserver
@server = 'taipei, -- 資料庫的server name
@provider = 'MSDASQL', -- Microsoft OLE DB Provider for ODBC
@datasrc = 'ds', -- db name
@srvproduct = 'Informix-CLI 2.5 (32 bit)' -- product version
GO
EXEC sp_addlinkedsrvlogin 'taipei', 'true'--, 'sa', 'login_name', 'password'
SELECT * FROM OPENQUERY(taipei, 'select * from ima_file')
SELECT count(*) CNT ,sum(imk09) s ,imk02,imk01,imk05,imk06 FROM OPENQUERY(tp, '
select * from imk_file where imk06>0 and imk01<>"MISC" and imk05=2009 and imk06=5
and imk09>0
') group by imk02,imk01,imk05,imk06 HAVING count(*) >1
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言