- 
            
            
as seen on SQL Blog
            - Search for 'SQL Blog' 
            
SQL Server has a few mechanisms to reach out to another server (even another server type) and query data from within a Transact-SQL statement. Among them are a set of stored credentials and information (called a Linked Server), a statement that uses a linked server called called OPENQUERY, another…
            >>> More
            
         
    
        - 
            
            
as seen on Stack Overflow
            - Search for 'Stack Overflow' 
            
I have 2 similar queries
select * 
from openquery(powerschool, 
                'select * 
                 from TEACHERS 
                 where teachernumber is not null 
                   and schoolid=''1050'' 
                   and teacherloginid is not null  
                 order by teachernumber')
and…
            >>> More
            
         
    
        - 
            
            
as seen on Stack Overflow
            - Search for 'Stack Overflow' 
            
I'm writing a script that is supposed to run around a bunch of servers and select a bunch of data out of them, including the local server. The SQL needed to SELECT the data I need is pretty complicated, so I'm writing sort of an ad-hoc view, and using an OPENQUERY statement to get the data, so ultimately…
            >>> More
            
         
    
        - 
            
            
as seen on Stack Overflow
            - Search for 'Stack Overflow' 
            
SQL Server doesn't allow creating an view with schema binding where the view query uses OpenQuery as shown below.
Is there a way or a walk-around to create an index on such a view?
            >>> More
            
         
    
        - 
            
            
as seen on Stack Overflow
            - Search for 'Stack Overflow' 
            
Hello,
I have a table called Table with columns:
ID (int, primary key, clustered, unique index)  
TEXT (varchar 15)
on a MSSQL linked server called LS. Linked server is on the same server computer. And:
When I call:
SELECT ID, TEXT FROM OPENQUERY(LS, 'SELECT ID, TEXT FROM Table')
It takes…
            >>> More