Skip to content

Commit d72a3ce

Browse files
committed
관련 쿼리문 추가
1 parent a6ffff8 commit d72a3ce

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

queries/queries-sample.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<var name="categoryIds">[1, 2, 3, 5]</var>
1414
<var name="maxRows">1000</var>
1515
</vars>
16-
<sheet name="${envType}_주문_목록" use="true" aggregateColumn="결제방법" maxRows="10" db="sampleDB">
16+
<sheet name="${envType}_주문_목록" use="true" aggregateColumn="결제방법" maxRows="100" db="sampleDB">
1717
<![CDATA[
1818
SELECT
1919
OrderNumber as 주문번호,
@@ -42,7 +42,7 @@
4242
ORDER BY CreditLimit DESC
4343
]]>
4444
</sheet>
45-
<sheet name="고객_목록_상세정보_지역별_통계_분석결과_요약테이블_최종버전" use="false">
45+
<sheet name="고객_목록_상세정보_지역별_통계_분석결과_요약테이블_최종버전" use="true">
4646
<![CDATA[
4747
SELECT
4848
o.OrderNumber as 주문번호,
@@ -58,7 +58,7 @@
5858
ORDER BY o.OrderDate DESC
5959
]]>
6060
</sheet>
61-
<sheet name="와일드카드기호사용_Customer" use="false">
61+
<sheet name="와일드카드기호사용_Customer" use="true">
6262
<![CDATA[
6363
SELECT c.*
6464
FROM SampleDB.dbo.Orders o
@@ -68,7 +68,7 @@
6868
ORDER BY o.OrderDate DESC
6969
]]>
7070
</sheet>
71-
<sheet name="와일드카드기호사용_Order" use="false">
71+
<sheet name="와일드카드기호사용_Order" use="true">
7272
<![CDATA[
7373
SELECT o.*
7474
FROM SampleDB.dbo.Orders o
@@ -78,7 +78,7 @@
7878
ORDER BY o.OrderDate DESC
7979
]]>
8080
</sheet>
81-
<sheet name="배열변수_주문상태별_조회" use="false" aggregateColumn="주문상태">
81+
<sheet name="배열변수_주문상태별_조회" use="true" aggregateColumn="주문상태">
8282
<![CDATA[
8383
SELECT
8484
OrderNumber as 주문번호,
@@ -94,7 +94,7 @@
9494
ORDER BY OrderDate DESC
9595
]]>
9696
</sheet>
97-
<sheet name="배열변수_카테고리별_상품" use="false" aggregateColumn="카테고리명">
97+
<sheet name="배열변수_카테고리별_상품" use="true" aggregateColumn="카테고리명">
9898
<![CDATA[
9999
SELECT
100100
p.ProductID as 상품ID,

resources/관련쿼리문.sql

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
----------------------------------------------------------------------
4+
-- 모든 FK 조회
5+
----------------------------------------------------------------------
6+
SELECT
7+
fk.name AS '외래키 이름',
8+
OBJECT_NAME(fkc.parent_object_id) AS '테이블 이름',
9+
c1.name AS '컬럼 이름',
10+
OBJECT_NAME(fkc.referenced_object_id) AS '참조된 테이블 이름',
11+
c2.name AS '참조된 컬럼 이름',
12+
fkc.constraint_column_id AS '외래키 순서',
13+
CONCAT('ALTER TABLE ', OBJECT_NAME(fkc.parent_object_id), ' DROP CONSTRAINT ', fk.name, ';') AS '삭제명령어'
14+
FROM
15+
sys.foreign_key_columns fkc
16+
INNER JOIN
17+
sys.columns c1 ON fkc.parent_column_id = c1.column_id AND fkc.parent_object_id = c1.object_id
18+
INNER JOIN
19+
sys.columns c2 ON fkc.referenced_column_id = c2.column_id AND fkc.referenced_object_id = c2.object_id
20+
INNER JOIN
21+
sys.foreign_keys fk ON fk.object_id = fkc.constraint_object_id
22+
ORDER BY
23+
OBJECT_NAME(fkc.parent_object_id), fkc.constraint_column_id;
24+
25+
26+
27+
28+
----------------------------------------------------------------------
29+
-- 모든 테이블 조회
30+
----------------------------------------------------------------------
31+
SELECT name, CONCAT('DROP TABLE ', name, ';') AS '테이블 삭제 명령어'
32+
FROM sys.tables;
33+

0 commit comments

Comments
 (0)