-- 양쪽 데이터베이스에
-- 제약 조건이 제대로 같은지 수량도 검사
select object_name(parent_object_id), count(name) from sys.objects
where type= 'D'
group by object_name(parent_object_id)
order by 1
select count(*) from sys.objects where type = 'D'
-- 인덱스 검사
-- 인덱스 한번에 쫙 검사
select object_name(object_id), count(*) cnt from sys.indexes
group by object_name(object_id)
select count(*) from sys.indexes
[출처] 데이터베이스간 제약조건 인덱스 비교검사|작성자 킬라오너
'SQL Server 2005' 카테고리의 다른 글
안정적인 데이타베이스 구축과 장애 복구 전략 (0) | 2008.07.16 |
---|---|
DSN ADD VB Script (0) | 2008.07.15 |
Celko - Thinking in Sets - Auxiliary, Temporal and Virtual Tables in SQL (Elsevier, 2008) (0) | 2008.07.10 |
권한 관리^^ (0) | 2008.07.08 |
xp_ReadErrorLog (1) | 2008.07.08 |