Hi, Try this
First, enable ad-hoc queries like so:
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
Then run the below query:
SELECT a.* FROM OPENROWSET('MSOLEDBSQL', 'DRIVER=SQL Server;SERVER=192.168.2.2;UID=yoursqlLoginId;PWD=yourSqlPassword;DATABASE=yourDatabaseName',
'SELECT * FROM tableName') a