반응형
/********************************************************************************************
-- Title : [SQL Server] SSMS 다중 서버 연결 쿼리
-- Reference : www.dbnuri.com
-- Key word : 다중 서버
********************************************************************************************/
-- 하나의 그룹에 관련된 서버를 등록해 둔다.(그림은 Default로 그냥 등록)
-- Title : [SQL Server] SSMS 다중 서버 연결 쿼리
-- Reference : www.dbnuri.com
-- Key word : 다중 서버
********************************************************************************************/
-- 하나의 그룹에 관련된 서버를 등록해 둔다.(그림은 Default로 그냥 등록)
-- 그룹에서 오른 버튼 메뉴의 "새 쿼리(Q)"를 실행하면 아래 그림의 분홍색 부분처럼 연결 메시지를
확인할 수 있다.(새쿼리 창 탭에는 <다중 로그인>이라고 뜬다.)
-- 아래 쿼리로 확인 할 수 있다.
select top 10 * from dbo.sysdatabases;
select * from sys.databases;
/*
-- s_uni는 SQL2000이라 sys스키마가 없어 에러 발생.
s_uni(sa): 메시지 208, 수준 16, 상태 1, 줄 1 개체 이름 'sys.databases'이(가) 잘못되었습니다. dbrangcom(DBRANGCOM\dBRang): (11개 행이 영향을 받음)
seattle(sa): (17개 행이 영향을 받음)
dbrangcom\sql2008(DBRANGCOM\dBRang): (7개 행이 영향을 받음)
*/
create table tempdb.dbo.ttt ( a int not null , b int not null );
insert into tempdb.dbo.ttt
select 1,1 union all
select 2,2 union all
select 3,3;
select * from tempdb.dbo.ttt;
select * from sys.databases;
/*
-- s_uni는 SQL2000이라 sys스키마가 없어 에러 발생.
s_uni(sa): 메시지 208, 수준 16, 상태 1, 줄 1 개체 이름 'sys.databases'이(가) 잘못되었습니다. dbrangcom(DBRANGCOM\dBRang): (11개 행이 영향을 받음)
seattle(sa): (17개 행이 영향을 받음)
dbrangcom\sql2008(DBRANGCOM\dBRang): (7개 행이 영향을 받음)
*/
create table tempdb.dbo.ttt ( a int not null , b int not null );
insert into tempdb.dbo.ttt
select 1,1 union all
select 2,2 union all
select 3,3;
select * from tempdb.dbo.ttt;
-- "도구 - 옵션 - 쿼리 결과 - SQL Server - 다중 서버 결과" 메뉴에서 쿼리 결과 출력 옵션을
설정할 수 있다.
반응형