EXECUTE AS 절이 있는 메타데이터가 포함된 SQL Server 마이그레이션 작업 만들기 및 실행
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
개요
SQL Server 마이그레이션 작업은 데이터베이스 사용자 및 서버 로그인 데이터를 마이그레이션하지 않습니다. 따라서 사용자가 EXECUTE AS '[database_user_name]' 절로 정의한 객체가 포함된 소스는 아직 사용자가 존재하지 않으므로 새 Cloud SQL 복제본으로 마이그레이션되지 않습니다. 그 결과 전체 이전 프로세스가 실패합니다.
예를 들면 다음과 같습니다.
CREATE OR ALTER PROCEDURE dbo.example
WITH EXECUTE AS 'some_user'
AS BEGIN
…
END
some_user 사용자를 이전할 수 없으므로 이 저장 프로시저는 이전되지 않습니다. 이는 타겟 데이터베이스에 사용자가 없기 때문입니다.
소스 데이터베이스에서 EXECUTE AS '[database_user_name]' 절을 사용하는 객체를 식별하려면 다음 쿼리를 사용하고 대상 데이터베이스에 해당 객체의 사용자가 있는지 확인합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[[["SQL Server migration jobs do not migrate database user and server login data, which can lead to migration failures."],["Objects defined with the `EXECUTE AS '[database_user_name]'` clause in the source database cannot be migrated if the specified user does not exist in the target database."],["A SQL query can identify which objects in the source database use the `EXECUTE AS '[database_user_name]'` clause."],["To prevent migration failure, users specified in the `EXECUTE AS` clause must be created on the destination Cloud SQL instance before the migration job begins."]]],[]]