I currently have a db which has been moved to different server, and have a different name, which causes some problems with me as that I am linked to the old server, and don't know all the entries which links this old server and database.
I keep getting this error:
Error: 100000 Severity: 16 State: 1 Error code:-1073548784 - Error description:Executing the query "declare @sql nvarchar(2000) declare @TableEntity v..." failed with the following error: The OLE DB provider "SQLNCLI11" for linked server "10.7.11.20" does not contain the table ""sax2012r2_prod"."dbo"."coresync"". The table either does not exist or the current user does not have permissions on that table.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
I've created a SQL Server alias that maps all 10.7.11.20 request to the new server.
Is it similarly possible to do so with the database, or somehow locate the places where it is looking in sax2012r2_prod?
SELECT * FROM sys.syscomments WHERE [text] like '%WhatIamlookingfor%'sys.syscommentscontains the text of stored procedures, views, functions, and other such SQL Code on the server. This searches through that code for examples of whatever string you are looking for. As for aliases, that's not what this does. It looks for places where the DB name is used in a section of code, then lets you know where you need to go to change the DB references. If the table is aliased, you still only need to change the DB references.