Use SQL to filter the results of a stored procedure

后端 未结 5 778
悲&欢浪女
悲&欢浪女 2021-02-05 01:41

I\'ve looked at other questions on Stack Overflow related to this question, but none of them seemed to answer this question clearly.

We have a system Stored Procedure ca

5条回答
  •  日久生厌
    2021-02-05 01:52

    OPENROWSET() is the way:

    SELECT *
    FROM
        OPENROWSET('SQLNCLI', 'Server=(local);TRUSTED_CONNECTION=YES;', 'exec sp_who')
    WHERE loginame = 'test' AND dbname = 'Expirement';
    

    Also you need enable advance config before working:

    sp_configure 'show advanced options', 1;  
    RECONFIGURE;
    GO
    sp_configure 'Ad Hoc Distributed Queries', 1; 
    RECONFIGURE;
    GO 
    

提交回复
热议问题