您的位置:首页 > 数据库

SQL Serve中SQL语句执行Access中子SQL语句

2006-02-13 23:12 344 查看
exec sp_addlinkedserver
@server = 'access',
@provider = 'Microsoft.Jet.OLEDB.4.0',
@srvproduct = 'OLE DB Provider for Jet',
@datasrc = 'C:/Inetpub/wwwroot/jasmine/packinglist/20051221pk-bridal.mdb'

exec ('sp_addlinkedsrvlogin ''access'', ''false'' ')
exec( ' select count( a.styleid) YCount ,a.styleid ,(select count(*) JCount from stylecode b with (nolock) where b.styleid=a.styleid and b.prodline in (select prodlineid from prodline with (nolock) where prodkind=0) ) JCount from OPENQUERY(access, ''select styleid from suppacklistcart'') a group by a.styleid order by JCount ')
EXEC sp_droplinkedsrvlogin 'access', NULL
exec sp_dropserver 'access'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: