Posts

Showing posts from December, 2018

CT and CDC Info

Checking CDC SELECT name FROM sys.tables where is_tracked_by_cdc=1 SELECT s.name AS Schema_Name, tb.name AS Table_Name , tb.object_id, tb.type, tb.type_desc, tb.is_tracked_by_cdc FROM sys.tables tb INNER JOIN sys.schemas s on s.schema_id = tb.schema_id WHERE tb.is_tracked_by_cdc = 1 and s.name+'.'+tb.name in ('dbo.areas','dbo.ComponentTags','dbo.Images','dbo.Productlines', 'focalpoint.RadioFrequencyCards','taxman.Chipsets','Masterdata.Components','Masterdata.SoftwareFormats', 'Qswat.Areas','Qswat.Products') order by 1 Enabling CDC on DB : EXEC sys.sp_cdc_enable_db Enabling CDC on Table: EXEC sys.sp_cdc_enable_table  @source_schema = N'dbo',  @source_name   = N'Test', @role_name     = NULL Disable CDC EXEC sys.sp_cdc_disable_table  @source_schema = N'dbo',  @source_name   = N'Test', @capture_instance  =...

Using Where/And in Joins

When Using the inner joins or any kind of joins we can use where/and   Ex : Select * from TableA inner join TableB  on TableA.Id =TableB.Id  Where/and TableA.Id=1 Here we will get the result same whether we use And /where 

Finding User Who Dropped Database Table

Image
CREATE DATABASE TestDB GO USE TestDB GO CREATE TABLE TestTable (ID INT ) GO ALTER TABLE TestTable ADD FirstCol VARCHAR (100) GO DROP TABLE TestTable GO