Hi, app uses cross db connections, the dbs are in different AG's, so I need them to use 4 part naming convention - in the place of servername would be listener name, but when I run a simple query like:
select * from Listener_Name.DatabaseName.[schemaname].[objectname]
Could not find server 'Listener_Name' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.
Listener_Name is not on sys.servers table.
My current env has 2 nodes, and 3 AGs each having their own listeners, Do I need to add the 3 Listener Names as linked servers on both nodes? And does anyone have a script on how best to create the linked server using listener name, I would like it to be similar to the local server which shows up on the sys.servers table with server_id 0.