7202: Could not find server 'name' in sys.servers (sys.servers에서 서버를 찾을 수 없음)
SQL Server의미
쿼리에서 linked server 또는 4부분 이름(server.database.schema.object)으로 참조한 서버 이름을 구성된 linked server 중에서 찾을 수 없다. SQL Server가 이름을 해석하지 못했다.
원인
linked server가 정의된 적이 없거나, 이름의 철자가 틀렸거나, 다른 환경(dev/prod)에 있는 linked server가 운영 환경에 없거나, OPENQUERY/4부분 이름이 잘못된 서버 이름을 가리키는 경우다. 스크립트를 서버 간에 옮길 때 흔하다.
해결 방법
정의된 linked server 목록 확인: SELECT name FROM sys.servers; 또는 EXEC sp_linkedservers. 필요하면 추가한다: EXEC sp_addlinkedserver @server='SERVER', ...; 이후 sp_addlinkedsrvlogin으로 로그인 매핑을 설정한다. 쿼리의 4부분 이름이 올바른 linked server 이름을 사용하는지 확인하고, 로컬 객체에만 접근한다면 서버 접두사를 제거한다.
같은 데이터베이스의 다른 항목
- 18452Login failed. The login is from an untrusted domain and cannot be used with Windows authentication (로그인 실패. 신뢰할 수 없는 도메인의 로그인은 Windows 인증에 사용할 수 없음)
- 605Attempt to fetch logical page belongs to a different allocation unit (가져오려는 논리 페이지가 다른 allocation unit에 속함)
- 4922ALTER TABLE ALTER COLUMN failed because one or more objects access this column (하나 이상의 객체가 이 컬럼에 접근하므로 ALTER TABLE ALTER COLUMN 실패)
- 40501The service is currently busy. Retry the request after 10 seconds (서비스가 현재 바쁨. 10초 후 재시도)
- 8645A time out occurred while waiting for memory resources to execute the query (쿼리 실행을 위한 메모리 리소스를 기다리는 중 타임아웃 발생)
- 8651Could not perform the operation because the requested memory grant was not available (요청한 memory grant를 사용할 수 없어 작업을 수행할 수 없음)
- 5061ALTER DATABASE failed because a lock could not be placed on database (데이터베이스에 락을 걸 수 없어 ALTER DATABASE 실패)