Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9bc55d6

Browse files
added sp_add_cdc
1 parent 900641a commit 9bc55d6

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

‎AWS RDS/sp_add_cdc.sql

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
/*****************************************************************
2+
-------------------------------------
3+
tsqltools - RDS Add CDC
4+
-------------------------------------
5+
Description: This stored procedure will help you to enable CDC on
6+
all the exsiting tables. You have to run this store procedure on the
7+
database where you need to add the tables. It won't support Cross
8+
database's tables.
9+
10+
How to Run: If you want to enable CDC on the tables which
11+
all are in DBAdmin database,
12+
13+
EXEC sp_add_cdc 'DBAdmin'
14+
15+
-------------------------------------------------------------------
16+
17+
Version: v1.0
18+
Release Date: 2018年02月09日
19+
Author: Bhuvanesh(@SQLadmin)
20+
Feedback: mailto:r.bhuvanesh@outlook.com
21+
Updates: https://github.com/SqlAdmin/tsqltools/
22+
License: GPL-3.0
23+
tsqltools is free to download.It contains Tsql stored procedures
24+
and scripts to help the DBAs and Developers to make job easier
25+
(C) 2017
26+
*******************************************************************/
27+
28+
-- READ THE DESCRIPTION BEFORE EXECUTE THIS ***
129
IF OBJECT_ID('dbo.sp_add_cdc') IS NULL
230
EXEC ('CREATE PROCEDURE dbo.sp_add_cdc AS RETURN 0;');
331
GO
@@ -42,7 +70,7 @@ BEGIN
4270
SELECT table_name
4371
FROM INFORMATION_SCHEMA.TABLES Join sys.tables t3 on table_name = t3.name
4472
where TABLE_NAME not in (select table_name
45-
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS) and table_schema !='cdc' and TABLE_NAME!='systranschemas' and t3.is_tracked_by_cdc=0;
73+
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS) and table_schema !='cdc' and TABLE_NAME!='systranschemas' and t3.is_tracked_by_cdc=0;
4674

4775
OPEN nonprimary_cursor
4876
FETCH NEXT FROM nonprimary_cursor INTO @name

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /