在开发asp.net web 应用的时候,在sqlserver2005 有两个库,lib1,lib2。在lib1中有表 tbl, 在lib2中有存储过程,其中语句select * from lib1.dbo.tbl where contains( col1, @key)运行时提示错误,"过程tbl的请求失败,因为tbl 是 表 对象 "。请问怎么解决?因为tbl是很大一个表,并且有索引,不想copy 到lib2中。 目前两个库在同一台服务器上。
调试欢乐多
select * from lib1.dbo..tbl where contains( col1, @key) //调用别的库 库名..表名
用 一个数据库中的 col1 与 @key 是否存在包含关系,去到另一个数据库中查找是否有满足条件的记录?逻辑上讲得通吗?
use master
Create table a (a int)
insert into a select 1use test
Create table a (a int)
insert into a select 1use master
select * from test..a
--1