SQLTeam.com | Weblogs | Forums

How to config sqlserver link server , we need ignore schema when use the sql query

sql2008r2

#1

EXEC master.dbo.sp_addlinkedserver @server = N'.dbname', @srvproduct=N'', @provider=N'SQLNCLI10', @datasrc=N'xxxxxxxxxxxx' and use below query to search the result
'SELECT xxx FROM dbname..tablename' and get error cannot find the table name, i have too much those sql query. i do not want to add the dbo in query, how can we ignore the dbo make this work fine.


#2

First you created a linked server, then do not use it in the query. Second, why do you not want to use schema? Do you have multiple schemas that you need to check?